recovery: for persistent db's don't set the dmaster to the recmaster node number
authorMichael Adam <obnox@samba.org>
Sun, 29 Nov 2009 10:17:18 +0000 (11:17 +0100)
committerMichael Adam <obnox@samba.org>
Fri, 4 Dec 2009 10:30:21 +0000 (11:30 +0100)
It is important to keep track of the dmaster (i.e. the node that last committed
a transaction containing changes to this node).

Michael

server/ctdb_recoverd.c

index 9edd4d5a950161705501ac6919ffbb52ebe2b3b1..3e596da9ecad9d88c8aa99184e4c94dac10a7720 100644 (file)
@@ -1057,7 +1057,9 @@ static int traverse_recdb(struct tdb_context *tdb, TDB_DATA key, TDB_DATA data,
 
        /* update the dmaster field to point to us */
        hdr = (struct ctdb_ltdb_header *)data.dptr;
-       hdr->dmaster = params->ctdb->pnn;
+       if (!params->persistent) {
+               hdr->dmaster = params->ctdb->pnn;
+       }
 
        /* add the record to the blob ready to send to the nodes */
        rec = ctdb_marshall_record(params->recdata, 0, key, NULL, data);