Skip to contentSkip to conversation

cluster/cmirror-kernel/src dm-cmirror-client.c ...

Cluster-devel [email protected] 1 participant 1 message Sep 21, 2007

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL4
Changes by: jbrassow at sourceware.org 2007-09-21 20:07:37

Modified files:
cmirror-kernel/src: dm-cmirror-client.c dm-cmirror-server.c
dm-cmirror-xfr.h

Log message:
Bug 291521: Cluster mirror can become out-of-sync if nominal I/O overla...

It is insufficient to simply delay flush requests that have marks pending to a recovering region. Although a collision between nominal I/O and resync I/O can be avoided this way, the state of the region changes from RH_NOSYNC to RH_CLEAN in the mean time. The machine being delayed will think the region is still in the RH_NOSYNC state and only write to the primary device... leaving the other mirror devices out-of-sync.

We must delay writes to remotely recovering regions before the state of the region is determined and cached in the region caching code... The entry point for this already exists in 'is_remote_recovering'.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cmirror-kernel/src/dm-cmirror-client.c.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.51&r2=1.1.2.52
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cmirror-kernel/src/dm-cmirror-server.c.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.37&r2=1.1.2.38
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cmirror-kernel/src/dm-cmirror-xfr.h.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.6&r2=1.1.2.7

cmirror-kernel/src/Attic/dm-cmirror-client.c +9 -1
@@ -858,7 +858,15 @@
 
 static int cluster_is_remote_recovering(struct dirty_log *log, region_t region)
 {
-	return 0;
+	int rtn;
+	struct log_c *lc = (struct log_c *) log->context;
+ 	 
+	if (atomic_read(&lc->in_sync) == 1) {
+		return 0;
+	}
+
+	rtn = consult_server(lc, region, LRT_IS_REMOTE_RECOVERING, NULL);
+	return rtn;
 }
 
 static int cluster_in_sync(struct dirty_log *log, region_t region, int block)
cmirror-kernel/src/Attic/dm-cmirror-server.c +68 -84

228 lines not on this page · raw message

cmirror-kernel/src/Attic/dm-cmirror-xfr.h +13 -12
@@ -10,18 +10,19 @@
 #define MAX_NAME_LEN 128
 
 #define LRT_IS_CLEAN			1
-#define LRT_IN_SYNC             	2
-#define LRT_MARK_REGION         	3
-#define LRT_CLEAR_REGION        	4
-#define LRT_FLUSH                       5
-#define LRT_GET_RESYNC_WORK     	6
-#define LRT_COMPLETE_RESYNC_WORK        7
-#define LRT_GET_SYNC_COUNT      	8
-
-#define LRT_ELECTION			9
-#define LRT_SELECTION			10
-#define LRT_MASTER_ASSIGN		11
-#define LRT_MASTER_LEAVING		12
+#define LRT_IS_REMOTE_RECOVERING	2
+#define LRT_IN_SYNC             	3
+#define LRT_MARK_REGION         	4
+#define LRT_CLEAR_REGION        	5
+#define LRT_FLUSH                       6
+#define LRT_GET_RESYNC_WORK     	7
+#define LRT_COMPLETE_RESYNC_WORK        8
+#define LRT_GET_SYNC_COUNT      	9
+
+#define LRT_ELECTION			10
+#define LRT_SELECTION			11
+#define LRT_MASTER_ASSIGN		12
+#define LRT_MASTER_LEAVING		13
 
 #define CLUSTER_LOG_PORT 51005