cluster/cmirror-kernel/src dm-cmirror-client.c ...
CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL4U4
Changes by: jbrassow at sourceware.org 2006-07-27 23:10:58
Modified files:
cmirror-kernel/src: dm-cmirror-client.c dm-cmirror-common.h
dm-cmirror-server.c
Log message:
- further tightening for 199826
We now refuse to read/write the disk log if we are suspended. We also add BUG_ON(<suspended>) to operations that do I/O to the log device.
The reason for the BUG_ON() is that it is better to drop the machine than to have it hang the cluster while it attempts to read/write from a suspended device. That being said, it should now be impossible to get to those functions which would perform I/O operations during suspension.
I have still seen cases where the mirror will stall. However, I think this is due to LVM (clvmd), because it happens when a mirror is created while the log device is suspended - which must not happen. I've only seen this when doing simultaneous create/convert/remove from all nodes in the cluster.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cmirror-kernel/src/dm-cmirror-client.c.diff?cvsroot=cluster&only_with_tag=RHEL4U4&r1=1.1.2.19.2.3&r2=1.1.2.19.2.4
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cmirror-kernel/src/dm-cmirror-common.h.diff?cvsroot=cluster&only_with_tag=RHEL4U4&r1=1.1.2.7.2.2&r2=1.1.2.7.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cmirror-kernel/src/dm-cmirror-server.c.diff?cvsroot=cluster&only_with_tag=RHEL4U4&r1=1.1.2.9.2.6&r2=1.1.2.9.2.7
cmirror-kernel/src/Attic/dm-cmirror-client.c +21 -32
@@ -302,7 +302,7 @@ lc->server_id = lr.u.lr_coordinator; }else {/* ATTENTION -- what do we do with this ? */ -DMWARN ("Failed to receive election results from server" ); +DMWARN ("Failed to receive election results from server: %d" , len); error = len; }
@@ -363,21 +363,7 @@ iov.iov_len =sizeof (struct log_request ); iov.iov_base = lr; -/* -DMERR("To :: 0x%x, %s", -saddr_in.sin_addr.s_addr, -(lr->lr_type == LRT_IS_CLEAN)? "LRT_IS_CLEAN": -(lr->lr_type == LRT_IN_SYNC)? "LRT_IN_SYNC": -(lr->lr_type == LRT_MARK_REGION)? "LRT_MARK_REGION": -(lr->lr_type == LRT_GET_RESYNC_WORK)? "LRT_GET_RESYNC_WORK": -(lr->lr_type == LRT_GET_SYNC_COUNT)? "LRT_GET_SYNC_COUNT": -(lr->lr_type == LRT_CLEAR_REGION)? "LRT_CLEAR_REGION": -(lr->lr_type == LRT_COMPLETE_RESYNC_WORK)? "LRT_COMPLETE_RESYNC_WORK": -(lr->lr_type == LRT_MASTER_LEAVING)? "LRT_MASTER_LEAVING": -(lr->lr_type == LRT_ELECTION)? "LRT_ELECTION": -(lr->lr_type == LRT_SELECTION)? "LRT_SELECTION": "UNKNOWN" -); -*/ +if (lr->lr_type ==LRT_MARK_REGION ){ mark_req2ser++; }
@@ -453,25 +439,28 @@ request_retry_count, request_count, dm_div_up(request_retry_count*100, request_count)); +DMDEBUG ("Last request:" ); +DMDEBUG (" - my_id :: %u" , my_id); +DMDEBUG (" - server :: %u" , lc->server_id); +DMDEBUG (" - log uuid:: %s (%s)" , + lc->uuid + (strlen (lc->uuid) -8 ), +atomic_read (&lc->suspended) ?"suspended" :"active" ); +DMDEBUG (" - request :: %s" , + (type ==LRT_IS_CLEAN )?"LRT_IS_CLEAN" : + (type ==LRT_IN_SYNC )?"LRT_IN_SYNC" : + (type ==LRT_MARK_REGION )?"LRT_MARK_REGION" : + (type ==LRT_GET_RESYNC_WORK )?"LRT_GET_RESYNC_WORK" : + (type ==LRT_GET_SYNC_COUNT )?"LRT_GET_SYNC_COUNT" : + (type ==LRT_CLEAR_REGION )?"LRT_CLEAR_REGION" : + (type ==LRT_COMPLETE_RESYNC_WORK )?"LRT_COMPLETE_RESYNC_WORK" : + (type ==LRT_MASTER_LEAVING )?"LRT_MASTER_LEAVING" : + (type ==LRT_ELECTION )?"LRT_ELECTION" : + (type ==LRT_SELECTION )?"LRT_SELECTION" :"UNKNOWN" ); +DMDEBUG (" - error :: %d" , error); } }if (lr)kfree (lr); -#if 0 -DMINFO ("My (%u) request (%s) to server (%u) failed :: %d" , - my_id, - (type ==LRT_IS_CLEAN )?"LRT_IS_CLEAN" : - (type ==LRT_IN_SYNC )?"LRT_IN_SYNC" : - (type ==LRT_MARK_REGION )?"LRT_MARK_REGION" : - (type ==LRT_GET_RESYNC_WORK )?"LRT_GET_RESYNC_WORK" : - (type ==LRT_GET_SYNC_COUNT )?"LRT_GET_SYNC_COUNT" : - (type ==LRT_CLEAR_REGION )?"LRT_CLEAR_REGION" : - (type ==LRT_COMPLETE_RESYNC_WORK )?"LRT_COMPLETE_RESYNC_WORK" : - (type ==LRT_MASTER_LEAVING )?"LRT_MASTER_LEAVING" : - (type ==LRT_ELECTION )?"LRT_ELECTION" : - (type ==LRT_SELECTION )?"LRT_SELECTION" :"UNKNOWN" , - lc->server_id, error); -#endif return error; }
@@ -739,7 +728,7 @@DMINFO ("Leaving while clear region requests remain." );list_del_init (&lc->log_list); -if (lc->server_id == my_id) +if ((lc->server_id == my_id) && !atomic_read (&lc->suspended))consult_server (lc,0 ,LRT_MASTER_LEAVING ,NULL );sock_release (lc->client_sock);
cmirror-kernel/src/Attic/dm-cmirror-common.h +1 -0
@@ -22,6 +22,7 @@ #define DMWARN(f, x...) printk(KERN_WARNING DM_NAME ": " f "\n" , ## x) #define DMERR(f, x...) printk(KERN_ERR DM_NAME ": " f "\n" , ## x) #define DMINFO(f, x...) printk(KERN_INFO DM_NAME ": " f "\n" , ## x) +#define DMDEBUG(f, x...) printk(KERN_DEBUG DM_NAME ": " f "\n" , ## x) #define DMEMIT(x...) sz += ((sz >= maxlen) ? \ 0 : scnprintf(result + sz, maxlen - sz, x))
cmirror-kernel/src/Attic/dm-cmirror-server.c +53 -18
153 lines not on this page · raw message