ctdbd: For volatile databases, write an empty record with rsn=0 only on dmaster
authorAmitay Isaacs <amitay@gmail.com>
Fri, 9 Aug 2013 07:22:55 +0000 (17:22 +1000)
committerAmitay Isaacs <amitay@gmail.com>
Thu, 22 Aug 2013 04:08:52 +0000 (14:08 +1000)
Empty record with rsn=0 should not be written on any other node other than
dmaster.  This is however not true for persistent databases.  So currently
apply the check only for volatile databases.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
common/ctdb_ltdb.c

index 0bfc377ff7d196338ba089b7dbbce714eebf7fb1..9c2a6898e05540d7497668fb8efa156f3e3af447 100644 (file)
@@ -98,7 +98,9 @@ int ctdb_ltdb_fetch(struct ctdb_db_context *ctdb_db,
                if (data) {
                        *data = d2;
                }
-               ctdb_ltdb_store(ctdb_db, key, header, d2);
+               if (ctdb_db->persistent || header->dmaster == ctdb_db->ctdb->pnn) {
+                       ctdb_ltdb_store(ctdb_db, key, header, d2);
+               }
                return 0;
        }