Rev 292: prioritise the dmaster in case of matching rsn in
http://samba.org/~tridge/ctdb
tridge at samba.org
tridge at samba.org
Sat May 12 09:57:12 GMT 2007
------------------------------------------------------------
revno: 292
revision-id: tridge at samba.org-20070512095712-rzuuw3raga2t2cyd
parent: tridge at samba.org-20070512095631-mqryf40232ncs0k6
committer: Andrew Tridgell <tridge at samba.org>
branch nick: tridge
timestamp: Sat 2007-05-12 19:57:12 +1000
message:
prioritise the dmaster in case of matching rsn
modified:
common/ctdb_recover.c ctdb_recover.c-20070503002147-admmfgt1oj6gexfo-1
=== modified file 'common/ctdb_recover.c'
--- a/common/ctdb_recover.c 2007-05-12 08:08:50 +0000
+++ b/common/ctdb_recover.c 2007-05-12 09:57:12 +0000
@@ -225,6 +225,7 @@
params.ctdb = ctdb;
params.lmaster = pull->lmaster;
+
params.rec_count = 0;
params.recs = talloc_array(outdata, struct getkeys_rec, 0);
CTDB_NO_MEMORY(ctdb, params.recs);
@@ -318,9 +319,10 @@
DEBUG(0, (__location__ " Unable to fetch record\n"));
goto failed;
}
- /* the <= is to cope with just-created records, which
- have a rsn of zero */
- if (header.rsn <= hdr->rsn) {
+ /* The check for dmaster gives priority to the dmaster
+ if the rsn values are equal */
+ if (header.rsn < hdr->rsn ||
+ (header.dmaster != ctdb->vnn && header.rsn == hdr->rsn)) {
ret = ctdb_ltdb_store(ctdb_db, key, hdr, data);
if (ret != 0) {
DEBUG(0, (__location__ " Unable to store record\n"));
More information about the samba-cvs
mailing list