debuggers.hg

changeset 20983:a948403c8f99

Remus: increase failover timeout from 500ms to 1s

500ms is aggressive enough to trigger split-brain under fairly
ordinary workloads, particularly for HVM. The long-term fix is to
integrate with a real HA monitor like linux HA.

Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Feb 12 09:23:10 2010 +0000 (2010-02-12)
parents a4ddf47a1e91
children 3bb163b74673
files tools/blktap2/drivers/block-remus.c tools/libxc/xc_domain_restore.c
line diff
     1.1 --- a/tools/blktap2/drivers/block-remus.c	Fri Feb 12 09:21:57 2010 +0000
     1.2 +++ b/tools/blktap2/drivers/block-remus.c	Fri Feb 12 09:23:10 2010 +0000
     1.3 @@ -59,7 +59,7 @@
     1.4  #include <unistd.h>
     1.5  
     1.6  /* timeout for reads and writes in ms */
     1.7 -#define NET_TIMEOUT 500
     1.8 +#define HEARTBEAT_MS 1000
     1.9  #define RAMDISK_HASHSIZE 128
    1.10  
    1.11  /* connect retry timeout (seconds) */
    1.12 @@ -604,8 +604,8 @@ static int mread(int fd, void* buf, size
    1.13  	int rc;
    1.14  	size_t cur = 0;
    1.15  	struct timeval tv = {
    1.16 -		.tv_sec = 0,
    1.17 -		.tv_usec = NET_TIMEOUT * 1000
    1.18 +		.tv_sec = HEARTBEAT_MS / 1000,
    1.19 +		.tv_usec = (HEARTBEAT_MS % 1000) * 1000
    1.20  	};
    1.21  
    1.22  	if (!len)
    1.23 @@ -649,8 +649,8 @@ static int mwrite(int fd, void* buf, siz
    1.24  	size_t cur = 0;
    1.25  	int rc;
    1.26  	struct timeval tv = {
    1.27 -		.tv_sec = 0,
    1.28 -		.tv_usec = NET_TIMEOUT * 1000
    1.29 +		.tv_sec = HEARTBEAT_MS / 1000,
    1.30 +		.tv_usec = (HEARTBEAT_MS % 1000) * 1000
    1.31  	};
    1.32  
    1.33  	if (!len)
     2.1 --- a/tools/libxc/xc_domain_restore.c	Fri Feb 12 09:21:57 2010 +0000
     2.2 +++ b/tools/libxc/xc_domain_restore.c	Fri Feb 12 09:23:10 2010 +0000
     2.3 @@ -444,7 +444,7 @@ alloc_page:
     2.4  /* set when a consistent image is available */
     2.5  static int completed = 0;
     2.6  
     2.7 -#define HEARTBEAT_MS 500
     2.8 +#define HEARTBEAT_MS 1000
     2.9  
    2.10  #ifndef __MINIOS__
    2.11  static ssize_t read_exact_timed(int fd, void* buf, size_t size)
    2.12 @@ -458,8 +458,8 @@ static ssize_t read_exact_timed(int fd, 
    2.13      {
    2.14          if ( completed ) {
    2.15              /* expect a heartbeat every HEARBEAT_MS ms maximum */
    2.16 -            tv.tv_sec = 0;
    2.17 -            tv.tv_usec = HEARTBEAT_MS * 1000;
    2.18 +            tv.tv_sec = HEARTBEAT_MS / 1000;
    2.19 +            tv.tv_usec = (HEARTBEAT_MS % 1000) * 1000;
    2.20  
    2.21              FD_ZERO(&rfds);
    2.22              FD_SET(fd, &rfds);