diff options
author | Michael Adam <obnox@samba.org> | 2010-12-10 14:11:38 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2011-03-14 13:35:45 +0100 |
commit | dbb520b6ad23b7c68c3280ee37e343ab2680cbd3 (patch) | |
tree | 7582fa0b09a24fc96896c3708853e283c9a89c1b /ctdb/server/ctdb_call.c | |
parent | 73e6618a487b4849e0bb790bdd85f3a889423297 (diff) | |
download | samba-dbb520b6ad23b7c68c3280ee37e343ab2680cbd3.tar.gz samba-dbb520b6ad23b7c68c3280ee37e343ab2680cbd3.tar.xz samba-dbb520b6ad23b7c68c3280ee37e343ab2680cbd3.zip |
call: becoming dmaster in VACUUM_MIGRATION, set the VACUUM_MIGRATED record flag
This temporary flag is used for the local record storage function to
decide whether to delete an empty record which has never been migrated
with data as part of the fast-path vacuuming process or, or to store
the record.
(This used to be ctdb commit c11ca778ee90444c44dee0a629cd2eefa3a1f75e)
Diffstat (limited to 'ctdb/server/ctdb_call.c')
-rw-r--r-- | ctdb/server/ctdb_call.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/ctdb/server/ctdb_call.c b/ctdb/server/ctdb_call.c index 44c633daef4..73072c3f758 100644 --- a/ctdb/server/ctdb_call.c +++ b/ctdb/server/ctdb_call.c @@ -282,6 +282,20 @@ static void ctdb_become_dmaster(struct ctdb_db_context *ctdb_db, header.dmaster = ctdb->pnn; header.flags = record_flags; + state = ctdb_reqid_find(ctdb, hdr->reqid, struct ctdb_call_state); + + if (state) { + if (state->call->flags & CTDB_CALL_FLAG_VACUUM_MIGRATION) { + /* + * We temporarily add the VACUUM_MIGRATED flag to + * the record flags, so that ctdb_ltdb_store can + * decide whether the record should be stored or + * deleted. + */ + header.flags |= CTDB_REC_FLAG_VACUUM_MIGRATED; + } + } + if (ctdb_ltdb_store(ctdb_db, key, &header, data) != 0) { ctdb_fatal(ctdb, "ctdb_reply_dmaster store failed\n"); @@ -292,7 +306,6 @@ static void ctdb_become_dmaster(struct ctdb_db_context *ctdb_db, return; } - state = ctdb_reqid_find(ctdb, hdr->reqid, struct ctdb_call_state); if (state == NULL) { DEBUG(DEBUG_ERR,("pnn %u Invalid reqid %u in ctdb_become_dmaster from node %u\n", |