Update Red Hat Copyright Notices
[nbdkit.git] / filters / retry / nbdkit-retry-filter.pod
blob6eba3d4ffd5d7c54fcd05919081283f44b3544e2
1 =head1 NAME
3 nbdkit-retry-filter - reopen connection on error
5 =head1 SYNOPSIS
7  nbdkit --filter=retry PLUGIN [retries=N] [retry-delay=N]
8                               [retry-exponential=yes|no]
9                               [retry-readonly=yes|no]
11 =head1 DESCRIPTION
13 C<nbdkit-retry-filter> is a filter that transparently reopens the
14 plugin connection when an error is encountered.  It can be used to
15 make long-running copy operations reliable in the presence of
16 temporary network failures, without requiring any changes to the
17 plugin or the NBD client.
19 An alternative and more fine-grained filter is
20 L<nbdkit-retry-request-filter(1)> which will retry only single
21 requests that fail.
23 Several optional parameters are available to control:
25 =over 4
27 =item *
29 how many times we retry,
31 =item *
33 the delay between retries, and whether we wait longer each time (known
34 as “exponential back-off”),
36 =item *
38 if we reopen the plugin in read-only mode after the first failure.
40 =back
42 The default (with no parameters) is designed to offer a happy medium
43 between recovering from short temporary failures but not doing
44 anything too bad when permanent or unrecoverable failures happen.  The
45 default behaviour is: we retry 5 times with exponential back-off,
46 waiting in total about 1 minute before we give up.
48 =head1 EXAMPLE
50 In this example we copy and convert a large file using
51 L<nbdkit-ssh-plugin(1)>, L<qemu-img(1)> and L<nbdkit-captive(1)>.
53  nbdkit -U - \
54    ssh host=remote.example.com /var/tmp/test.iso \
55    --filter=retry \
56    --run 'qemu-img convert -p -f raw $nbd -O qcow2 test.qcow2'
58 Without I<--filter=retry> a temporary failure would cause the copy to
59 fail (for example, the remote host’s firewall is restarted causing the
60 SSH connection to be dropped).  Adding this filter means that it may
61 be possible to transparently recover.
63 =head1 PARAMETERS
65 =over 4
67 =item B<retries=>N
69 The number of times any single operation will be retried before we
70 give up and fail the operation.  The default is 5.
72 =item B<retry-delay=>N
74 The number of seconds to wait before retrying.  The default is 2
75 seconds.
77 =item B<retry-exponential=yes>
79 Use exponential back-off.  The retry delay is doubled between each
80 retry.  This is the default.
82 =item B<retry-exponential=no>
84 Do not use exponential back-off.  The retry delay is the same between
85 each retry.
87 =item B<retry-readonly=yes>
89 As soon as a failure occurs, switch the underlying plugin to read-only
90 mode for the rest of this connection.  (A new NBD client connection
91 will still open the plugin in the original mode.)
93 =item B<retry-readonly=no>
95 Do not change the read-write/read-only mode of the plugin when
96 retrying.  This is the default.
98 =back
100 =head1 FILES
102 =over 4
104 =item F<$filterdir/nbdkit-retry-filter.so>
106 The filter.
108 Use C<nbdkit --dump-config> to find the location of C<$filterdir>.
110 =back
112 =head1 VERSION
114 C<nbdkit-retry-filter> first appeared in nbdkit 1.16.
116 =head1 SEE ALSO
118 L<nbdkit(1)>,
119 L<nbdkit-filter(3)>,
120 L<nbdkit-readahead-filter(1)>,
121 L<nbdkit-retry-request-filter(1)>.
123 =head1 AUTHORS
125 Richard W.M. Jones
127 =head1 COPYRIGHT
129 Copyright Red Hat