client: set dmaster in ctdb_transaction_store() also when updating an existing record
authorMichael Adam <obnox@samba.org>
Thu, 16 Jul 2009 20:00:10 +0000 (22:00 +0200)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Wed, 29 Jul 2009 00:28:35 +0000 (10:28 +1000)
Michael

client/ctdb_client.c

index 3889356884895276c9a45db03d19b304d4e41334..19a935023f4d31a1e5d45d547d2ed2e134973697 100644 (file)
@@ -3268,8 +3268,7 @@ int ctdb_transaction_store(struct ctdb_transaction_handle *h,
                /* the record doesn't exist - create one with us as dmaster.
                   This is only safe because we are in a transaction and this
                   is a persistent database */
-               header.dmaster = h->ctdb_db->ctdb->pnn;
-               header.rsn = 0;
+               ZERO_STRUCT(header);
        } else if (ret != 0) {
                DEBUG(DEBUG_ERR,(__location__ " Failed to fetch record\n"));
                talloc_free(tmp_ctx);
@@ -3283,6 +3282,7 @@ int ctdb_transaction_store(struct ctdb_transaction_handle *h,
                return 0;
        }
 
+       header.dmaster = h->ctdb_db->ctdb->pnn;
        header.rsn++;
 
        if (!h->in_replay) {