mirror of
https://github.com/samba-team/samba.git
synced 2025-03-24 10:50:22 +03:00
merge from tridge
(This used to be ctdb commit 826058b547b8e836f0a7066e9479e481ad9c472e)
This commit is contained in:
commit
7769a2d45e
@ -221,7 +221,7 @@ static void ctdb_send_dmaster_reply(struct ctdb_db_context *ctdb_db,
|
||||
|
||||
r->hdr.destnode = new_dmaster;
|
||||
r->hdr.reqid = reqid;
|
||||
r->rsn = header->rsn + 1;
|
||||
r->rsn = header->rsn;
|
||||
r->keylen = key.dsize;
|
||||
r->datalen = data.dsize;
|
||||
r->db_id = ctdb_db->db_id;
|
||||
@ -263,7 +263,7 @@ static void ctdb_call_send_dmaster(struct ctdb_db_context *ctdb_db,
|
||||
r->hdr.destnode = lmaster;
|
||||
r->hdr.reqid = c->hdr.reqid;
|
||||
r->db_id = c->db_id;
|
||||
r->rsn = header->rsn + 1;
|
||||
r->rsn = header->rsn;
|
||||
r->dmaster = c->hdr.srcnode;
|
||||
r->keylen = key->dsize;
|
||||
r->datalen = data->dsize;
|
||||
@ -295,7 +295,7 @@ static void ctdb_become_dmaster(struct ctdb_db_context *ctdb_db,
|
||||
DEBUG(2,("vnn %u dmaster response %08x\n", ctdb->vnn, ctdb_hash(&key)));
|
||||
|
||||
ZERO_STRUCT(header);
|
||||
header.rsn = rsn;
|
||||
header.rsn = rsn + 1;
|
||||
header.dmaster = ctdb->vnn;
|
||||
|
||||
if (ctdb_ltdb_store(ctdb_db, key, &header, data) != 0) {
|
||||
|
@ -145,6 +145,17 @@ int ctdb_ltdb_store(struct ctdb_db_context *ctdb_db, TDB_DATA key,
|
||||
TDB_DATA rec;
|
||||
int ret;
|
||||
|
||||
if (ctdb->flags & CTDB_FLAG_TORTURE) {
|
||||
struct ctdb_ltdb_header *h2;
|
||||
rec = tdb_fetch(ctdb_db->ltdb->tdb, key);
|
||||
h2 = (struct ctdb_ltdb_header *)rec.dptr;
|
||||
if (rec.dptr && rec.dsize >= sizeof(h2) && h2->rsn > header->rsn) {
|
||||
DEBUG(0,("RSN regression! %llu %llu\n",
|
||||
(unsigned long long)h2->rsn, (unsigned long long)header->rsn));
|
||||
}
|
||||
if (rec.dptr) free(rec.dptr);
|
||||
}
|
||||
|
||||
rec.dsize = sizeof(*header) + data.dsize;
|
||||
rec.dptr = talloc_size(ctdb, rec.dsize);
|
||||
CTDB_NO_MEMORY(ctdb, rec.dptr);
|
||||
|
Loading…
x
Reference in New Issue
Block a user