mirror: Reduce the mirror convergence window to 5 seonds, from 60
Also remove some obsolete constants
This commit is contained in:
14
src/mirror.c
14
src/mirror.c
@@ -213,18 +213,6 @@ void mirror_destroy( struct mirror *mirror )
|
|||||||
/** The mirror code will split NBD writes, making them this long as a maximum */
|
/** The mirror code will split NBD writes, making them this long as a maximum */
|
||||||
static const int mirror_longest_write = 8<<20;
|
static const int mirror_longest_write = 8<<20;
|
||||||
|
|
||||||
/** If, during a mirror pass, we have sent this number of bytes or fewer, we
|
|
||||||
* go to freeze the I/O and finish it off. This is just a guess.
|
|
||||||
*/
|
|
||||||
static const unsigned int mirror_last_pass_after_bytes_written = 100<<20;
|
|
||||||
|
|
||||||
/** The largest number of full passes we'll do - the last one will always
|
|
||||||
* cause the I/O to freeze, however many bytes are left to copy.
|
|
||||||
*/
|
|
||||||
static const int mirror_maximum_passes = 7;
|
|
||||||
#define mirror_last_pass (mirror_maximum_passes - 1)
|
|
||||||
|
|
||||||
|
|
||||||
/* This must not be called if there's any chance of further I/O. Methods to
|
/* This must not be called if there's any chance of further I/O. Methods to
|
||||||
* ensure this include:
|
* ensure this include:
|
||||||
* - Ensure image size is 0
|
* - Ensure image size is 0
|
||||||
@@ -603,7 +591,7 @@ static void mirror_read_cb( struct ev_loop *loop, ev_io *w, int revents )
|
|||||||
|
|
||||||
/* Regardless of time estimates, if there's no waiting transfer, we can
|
/* Regardless of time estimates, if there's no waiting transfer, we can
|
||||||
* */
|
* */
|
||||||
if ( !ctrl->clients_closed && ( !next_xfer || server_mirror_eta( ctrl->serve ) < 60 ) ) {
|
if ( !ctrl->clients_closed && ( !next_xfer || server_mirror_eta( ctrl->serve ) < MS_CONVERGE_TIME_SECS ) ) {
|
||||||
info( "Closing clients to allow mirroring to converge" );
|
info( "Closing clients to allow mirroring to converge" );
|
||||||
server_forbid_new_clients( ctrl->serve );
|
server_forbid_new_clients( ctrl->serve );
|
||||||
server_close_clients( ctrl->serve );
|
server_close_clients( ctrl->serve );
|
||||||
|
12
src/mirror.h
12
src/mirror.h
@@ -18,6 +18,18 @@ enum mirror_state;
|
|||||||
*/
|
*/
|
||||||
#define MS_CONNECT_TIME_SECS 60
|
#define MS_CONNECT_TIME_SECS 60
|
||||||
|
|
||||||
|
/* MS_MAX_DOWNTIME_SECS
|
||||||
|
* The length of time a migration must be estimated to have remaining for us to
|
||||||
|
* disconnect clients for convergence
|
||||||
|
*
|
||||||
|
* TODO: Make this configurable so refusing-to-converge clients can be manually
|
||||||
|
* fixed.
|
||||||
|
* TODO: Make this adaptive - 5 seconds is fine, as long as we can guarantee
|
||||||
|
* that all migrations will be able to converge in time. We'd add a new
|
||||||
|
* state between open and closed, where gradually-increasing latency is
|
||||||
|
* added to client requests to allow the mirror to be faster.
|
||||||
|
*/
|
||||||
|
#define MS_CONVERGE_TIME_SECS 5
|
||||||
|
|
||||||
/* MS_HELLO_TIME_SECS
|
/* MS_HELLO_TIME_SECS
|
||||||
* The length of time the sender will wait for the NBD hello message
|
* The length of time the sender will wait for the NBD hello message
|
||||||
|
Reference in New Issue
Block a user