summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2009-12-11 17:05:30 +0100
committerMichael Adam <obnox@samba.org>2009-12-12 00:45:40 +0100
commitb41d9a2bcc798ca51cbd7ca2bf2ce8276adefab6 (patch)
tree57065bb73b965c54e03b2f415755f6e8baf4ae30
parentf6ea3e6bcfce636d41bebb5599aa6b948b9bb884 (diff)
downloadsamba-b41d9a2bcc798ca51cbd7ca2bf2ce8276adefab6.tar.gz
samba-b41d9a2bcc798ca51cbd7ca2bf2ce8276adefab6.tar.xz
samba-b41d9a2bcc798ca51cbd7ca2bf2ce8276adefab6.zip
Revert "recovery: add special pull-logic for persistent databases"
This reverts commit 8aef46d2aab3efb322dda51eaa202653cefd5222. This special recovery logic is wrong now with the transaction rewrite. The treatment of persistent databases will later be rewritten to use the database sequence number. Michael (This used to be ctdb commit c5a0aef668a63f927d6184612b13ce316eb4a0be)
-rw-r--r--ctdb/server/ctdb_recoverd.c58
1 files changed, 4 insertions, 54 deletions
diff --git a/ctdb/server/ctdb_recoverd.c b/ctdb/server/ctdb_recoverd.c
index 752fd4752c..3ae0db4978 100644
--- a/ctdb/server/ctdb_recoverd.c
+++ b/ctdb/server/ctdb_recoverd.c
@@ -529,7 +529,6 @@ static int pull_one_remote_database(struct ctdb_context *ctdb, uint32_t srcnode,
struct ctdb_marshall_buffer *reply;
struct ctdb_rec_data *rec;
int i;
- int32_t transaction_active = 0;
TALLOC_CTX *tmp_ctx = talloc_new(recdb);
ret = ctdb_ctrl_pulldb(ctdb, srcnode, dbid, CTDB_LMASTER_ANY, tmp_ctx,
@@ -549,18 +548,6 @@ static int pull_one_remote_database(struct ctdb_context *ctdb, uint32_t srcnode,
}
rec = (struct ctdb_rec_data *)&reply->data[0];
-
- if (persistent) {
- transaction_active = ctdb_ctrl_transaction_active(ctdb, srcnode,
- dbid);
- if (transaction_active == -1) {
- DEBUG(DEBUG_ERR, (__location__ " error calling "
- "ctdb_ctrl_transaction_active to node"
- " %u\n", srcnode));
- talloc_free(tmp_ctx);
- return -1;
- }
- }
for (i=0;
i<reply->count;
@@ -596,42 +583,12 @@ static int pull_one_remote_database(struct ctdb_context *ctdb, uint32_t srcnode,
}
header = *(struct ctdb_ltdb_header *)existing.dptr;
free(existing.dptr);
- if (!persistent) {
- if (!(header.rsn < hdr->rsn ||
- (header.dmaster != ctdb->recovery_master && header.rsn == hdr->rsn)))
- {
- continue;
- }
- } else {
- if (header.lacount == (uint32_t)-1) {
- /*
- * skip record if the stored copy came
- * from a node with active transaction
- */
- continue;
- }
-
- if ((header.rsn >= hdr->rsn) &&
- !transaction_active)
- {
- continue;
- }
- }
- }
-
- if (persistent) {
- /*
- * Misuse the lacount field to signal
- * that we got the record from a node
- * that has a transaction running.
- */
- if (transaction_active) {
- hdr->lacount = (uint32_t)-1;
- } else {
- hdr->lacount = 0;
+ if (!(header.rsn < hdr->rsn ||
+ (header.dmaster != ctdb->recovery_master && header.rsn == hdr->rsn))) {
+ continue;
}
}
-
+
if (tdb_store(recdb->tdb, key, data, TDB_REPLACE) != 0) {
DEBUG(DEBUG_CRIT,(__location__ " Failed to store record\n"));
talloc_free(tmp_ctx);
@@ -1102,13 +1059,6 @@ static int traverse_recdb(struct tdb_context *tdb, TDB_DATA key, TDB_DATA data,
hdr = (struct ctdb_ltdb_header *)data.dptr;
if (!params->persistent) {
hdr->dmaster = params->ctdb->pnn;
- } else {
- /*
- * Clear the lacount field that had been misused
- * when pulling the db in order to keep track of
- * whether the node had a transaction running.
- */
- hdr->lacount = 0;
}
/* add the record to the blob ready to send to the nodes */