From: jbrassow@sourceware.org <jbrassow@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/cmirror-kernel/src dm-cmirror-client.c ...
Date: 14 Feb 2007 17:44:10 -0000 [thread overview]
Message-ID: <20070214174410.25253.qmail@sourceware.org> (raw)
CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL4
Changes by: jbrassow at sourceware.org 2007-02-14 17:44:08
Modified files:
cmirror-kernel/src: dm-cmirror-client.c dm-cmirror-common.h
dm-cmirror-server.c dm-cmirror-xfr.h
Log message:
Changes to fix the following bugs:
Bug 228104: greater than 2 legged cluster mirrors do not down ...
Bug 228056: lvconvert should give warning if we don't support ...
When converting from 3-way to 2-way mirror, the UUID for the mirror
stays the same. This creates conflicting entries in the cluster
logging code. I've added an additional identifier to allow for
unique identification in these cases.
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.35&r2=1.1.2.36
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cmirror-kernel/src/dm-cmirror-common.h.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.10&r2=1.1.2.11
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.20&r2=1.1.2.21
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.1&r2=1.1.2.2
--- cluster/cmirror-kernel/src/Attic/dm-cmirror-client.c 2007/02/02 17:22:55 1.1.2.35
+++ cluster/cmirror-kernel/src/Attic/dm-cmirror-client.c 2007/02/14 17:44:07 1.1.2.36
@@ -257,6 +257,7 @@
lr.u.lr_starter = my_id;
lr.u.lr_coordinator = initial_server;
memcpy(lr.lr_uuid, lc->uuid, MAX_NAME_LEN);
+ lr.lr_uuid_ref = lc->uuid_ref;
memset(&saddr_in, 0, sizeof(struct sockaddr_cl));
@@ -342,6 +343,7 @@
lr->u.lr_int_rtn = (*result) ? 1 : 0;
memcpy(lr->lr_uuid, lc->uuid, MAX_NAME_LEN);
+ lr->lr_uuid_ref = lc->uuid_ref;
memset(&saddr_in, 0, sizeof(struct sockaddr_in));
@@ -630,16 +632,19 @@
}
atomic_set(&lc->in_sync, -1);
+ lc->uuid_ref = 1;
list_for_each_entry(tmp_lc, &log_list_head, log_list){
if(!strncmp(tmp_lc->uuid, lc->uuid, MAX_NAME_LEN)){
- DMERR("Log already exists with uuid, %s",
- lc->uuid + (strlen(lc->uuid) - 8));
- error = -EINVAL;
- goto fail;
+ lc->uuid_ref = (lc->uuid_ref > tmp_lc->uuid_ref) ?
+ lc->uuid_ref : tmp_lc->uuid_ref + 1;
}
}
+ DMDEBUG("Creating %s (%d)",
+ lc->uuid + (strlen(lc->uuid) - 8),
+ lc->uuid_ref);
+
list_add(&lc->log_list, &log_list_head);
INIT_LIST_HEAD(&lc->region_users);
@@ -744,10 +749,15 @@
struct log_c *lc = (struct log_c *) log->context;
struct region_state *rs, *tmp_rs;
+ DMDEBUG("Removing %s (%d)",
+ lc->uuid + (strlen(lc->uuid) - 8),
+ lc->uuid_ref);
+
if (!list_empty(&clear_region_list))
DMINFO("Leaving while clear region requests remain.");
list_del_init(&lc->log_list);
+
if ((lc->server_id == my_id) && !atomic_read(&lc->suspended))
consult_server(lc, 0, LRT_MASTER_LEAVING, NULL);
@@ -767,6 +777,7 @@
spin_unlock(®ion_state_lock);
+
if (lc->log_dev)
disk_dtr(log);
else
--- cluster/cmirror-kernel/src/Attic/dm-cmirror-common.h 2006/07/27 23:11:55 1.1.2.10
+++ cluster/cmirror-kernel/src/Attic/dm-cmirror-common.h 2007/02/14 17:44:07 1.1.2.11
@@ -129,6 +129,7 @@
* Cluster log fields
*/
char uuid[MAX_NAME_LEN];
+ int uuid_ref;
atomic_t in_sync; /* like sync_count, except all or nothing */
struct list_head log_list;
--- cluster/cmirror-kernel/src/Attic/dm-cmirror-server.c 2007/02/02 17:22:55 1.1.2.20
+++ cluster/cmirror-kernel/src/Attic/dm-cmirror-server.c 2007/02/14 17:44:07 1.1.2.21
@@ -645,11 +645,12 @@
}
}
-static struct log_c *get_log_context(char *uuid){
+static struct log_c *get_log_context(char *uuid, int uuid_ref){
struct log_c *lc, *r = NULL;
list_for_each_entry(lc, &log_list_head, log_list){
- if(!strncmp(lc->uuid, uuid, MAX_NAME_LEN)){
+ if (!strncmp(lc->uuid, uuid, MAX_NAME_LEN) &&
+ (uuid_ref == lc->uuid_ref)) {
if (r)
report_duplicate_log(lc);
else
@@ -866,7 +867,7 @@
if(error < sizeof(struct log_request)){
DMERR("Cluster mirror log server received incomplete message.");
}
- lc = get_log_context(lr.lr_uuid);
+ lc = get_log_context(lr.lr_uuid, lr.lr_uuid_ref);
if(lr.lr_type == LRT_ELECTION ||
lr.lr_type == LRT_SELECTION ||
--- cluster/cmirror-kernel/src/Attic/dm-cmirror-xfr.h 2005/07/27 16:09:31 1.1.2.1
+++ cluster/cmirror-kernel/src/Attic/dm-cmirror-xfr.h 2007/02/14 17:44:07 1.1.2.2
@@ -41,6 +41,7 @@
};
} u;
char lr_uuid[MAX_NAME_LEN];
+ int lr_uuid_ref;
};
int my_recvmsg(struct socket *sock, struct msghdr *msg,
next reply other threads:[~2007-02-14 17:44 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-14 17:44 jbrassow [this message]
-- strict thread matches above, loose matches on Subject: below --
2007-10-03 19:02 [Cluster-devel] cluster/cmirror-kernel/src dm-cmirror-client.c jbrassow
2007-09-27 20:31 jbrassow
2007-09-26 3:15 jbrassow
2007-09-21 20:07 jbrassow
2007-09-13 15:24 jbrassow
2007-07-11 16:18 jbrassow
2007-04-26 16:55 jbrassow
2007-04-26 16:54 jbrassow
2007-04-24 20:10 jbrassow
2007-04-24 20:08 jbrassow
2007-04-10 7:13 jbrassow
2007-04-10 7:12 jbrassow
2007-04-05 21:33 jbrassow
2007-04-05 21:32 jbrassow
2007-04-03 18:23 jbrassow
2007-04-03 18:21 jbrassow
2007-03-22 22:34 jbrassow
2007-03-22 22:22 jbrassow
2007-03-14 4:28 jbrassow
2007-02-26 17:38 jbrassow
2007-02-20 19:35 jbrassow
2007-02-19 16:29 jbrassow
2007-02-02 17:22 jbrassow
2007-01-08 19:28 jbrassow
2006-12-07 18:58 jbrassow
2006-09-05 17:50 jbrassow
2006-09-05 17:48 jbrassow
2006-07-27 23:11 jbrassow
2006-07-27 23:11 jbrassow
2006-07-22 22:19 jbrassow
2006-07-22 22:19 jbrassow
2006-07-22 22:12 jbrassow
2006-06-29 19:49 jbrassow
2006-06-29 19:48 jbrassow
2006-06-29 19:46 jbrassow
2006-06-27 20:19 jbrassow
2006-06-15 19:48 jbrassow
2006-06-15 19:34 jbrassow
2006-06-13 16:26 jbrassow
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070214174410.25253.qmail@sourceware.org \
--to=jbrassow@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).