samba-cvs.cvs
[Top] [All Lists]

Rev 292: prioritise the dmaster in case of matching rsn in http://samba.

Subject: Rev 292: prioritise the dmaster in case of matching rsn in http://samba.org/~tridge/ctdb
From:
Date: Sat, 12 May 2007 19:57:12 +1000
------------------------------------------------------------
revno: 292
revision-id: tridge@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
parent: tridge@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
committer: Andrew Tridgell <tridge@xxxxxxxxx>
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"));

<Prev in Thread] Current Thread [Next in Thread>
  • Rev 292: prioritise the dmaster in case of matching rsn in http://samba.org/~tridge/ctdb, tridge <=