summaryrefslogtreecommitdiffstats
path: root/ctdb/server/ctdb_ltdb_server.c
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2010-12-21 17:50:52 +0100
committerMichael Adam <obnox@samba.org>2011-03-14 13:35:51 +0100
commit7088e2144fb7bc2e86f9e02414cb92c1300823ea (patch)
tree31bde2e0ab4de1321ef0f3fb32ca4e6a1be32dcd /ctdb/server/ctdb_ltdb_server.c
parent6384512eb75aac4af8991ef42e6f13ded9c889cb (diff)
downloadsamba-7088e2144fb7bc2e86f9e02414cb92c1300823ea.tar.gz
samba-7088e2144fb7bc2e86f9e02414cb92c1300823ea.tar.xz
samba-7088e2144fb7bc2e86f9e02414cb92c1300823ea.zip
ctdb_ltdb_store_server: always store the data when ctdb_ltdb_store() is called from the client
This also fixes a segfault since ctdb_lmaster uses the vnn_map. (This used to be ctdb commit e58c8f51f27e468897af5210b80e5f5f45c3c4bb)
Diffstat (limited to 'ctdb/server/ctdb_ltdb_server.c')
-rw-r--r--ctdb/server/ctdb_ltdb_server.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/ctdb/server/ctdb_ltdb_server.c b/ctdb/server/ctdb_ltdb_server.c
index b4a0d7f580..bcd53e21bf 100644
--- a/ctdb/server/ctdb_ltdb_server.c
+++ b/ctdb/server/ctdb_ltdb_server.c
@@ -67,7 +67,7 @@ static int ctdb_ltdb_store_server(struct ctdb_db_context *ctdb_db,
int ret;
bool seqnum_suppressed = false;
bool keep = false;
- uint32_t lmaster = ctdb_lmaster(ctdb_db->ctdb, &key);
+ uint32_t lmaster;
if (ctdb->flags & CTDB_FLAG_TORTURE) {
struct ctdb_ltdb_header *h2;
@@ -80,6 +80,17 @@ static int ctdb_ltdb_store_server(struct ctdb_db_context *ctdb_db,
if (rec.dptr) free(rec.dptr);
}
+ if (ctdb->vnn_map == NULL) {
+ /*
+ * Called from a client: always store the record
+ * Also don't call ctdb_lmaster since it uses the vnn_map!
+ */
+ keep = true;
+ goto store;
+ }
+
+ lmaster = ctdb_lmaster(ctdb_db->ctdb, &key);
+
/*
* If we migrate an empty record off to another node
* and the record has not been migrated with data,
@@ -116,6 +127,7 @@ static int ctdb_ltdb_store_server(struct ctdb_db_context *ctdb_db,
keep = true;
}
+store:
/*
* The VACUUM_MIGRATED flag is only set temporarily for
* the above logic when the record was retrieved by a