]> xenbits.xensource.com Git - xen.git/commitdiff
Remus: increase failover timeout from 500ms to 1s
authorKeir Fraser <keir.fraser@citrix.com>
Fri, 12 Feb 2010 09:23:10 +0000 (09:23 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Fri, 12 Feb 2010 09:23:10 +0000 (09:23 +0000)
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>
tools/blktap2/drivers/block-remus.c
tools/libxc/xc_domain_restore.c

index ca9a814c978a380d708a45ba68c9f9c424f53965..a068878385021fec872716a761cb2544c102a097 100644 (file)
@@ -59,7 +59,7 @@
 #include <unistd.h>
 
 /* timeout for reads and writes in ms */
-#define NET_TIMEOUT 500
+#define HEARTBEAT_MS 1000
 #define RAMDISK_HASHSIZE 128
 
 /* connect retry timeout (seconds) */
@@ -604,8 +604,8 @@ static int mread(int fd, void* buf, size_t len)
        int rc;
        size_t cur = 0;
        struct timeval tv = {
-               .tv_sec = 0,
-               .tv_usec = NET_TIMEOUT * 1000
+               .tv_sec = HEARTBEAT_MS / 1000,
+               .tv_usec = (HEARTBEAT_MS % 1000) * 1000
        };
 
        if (!len)
@@ -649,8 +649,8 @@ static int mwrite(int fd, void* buf, size_t len)
        size_t cur = 0;
        int rc;
        struct timeval tv = {
-               .tv_sec = 0,
-               .tv_usec = NET_TIMEOUT * 1000
+               .tv_sec = HEARTBEAT_MS / 1000,
+               .tv_usec = (HEARTBEAT_MS % 1000) * 1000
        };
 
        if (!len)
index 4c04bf8a5309e12280e2726240dafa9017991824..8aa58a1db91e57923a7f8dc1a570d16539660c02 100644 (file)
@@ -444,7 +444,7 @@ alloc_page:
 /* set when a consistent image is available */
 static int completed = 0;
 
-#define HEARTBEAT_MS 500
+#define HEARTBEAT_MS 1000
 
 #ifndef __MINIOS__
 static ssize_t read_exact_timed(int fd, void* buf, size_t size)
@@ -458,8 +458,8 @@ static ssize_t read_exact_timed(int fd, void* buf, size_t size)
     {
         if ( completed ) {
             /* expect a heartbeat every HEARBEAT_MS ms maximum */
-            tv.tv_sec = 0;
-            tv.tv_usec = HEARTBEAT_MS * 1000;
+            tv.tv_sec = HEARTBEAT_MS / 1000;
+            tv.tv_usec = (HEARTBEAT_MS % 1000) * 1000;
 
             FD_ZERO(&rfds);
             FD_SET(fd, &rfds);