Bug 11398 - CTDB recovery reduces sequence number for persistent databases
CTDB recovery reduces sequence number for persistent databases
Status: RESOLVED FIXED
Product: CTDB 2.5.x or older
Classification: Unclassified
Component: ctdb
unspecified
All All
: P5 normal
: ---
Assigned To: Karolin Seeger
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-07-14 07:10 UTC by Amitay Isaacs
Modified: 2015-07-21 14:41 UTC (History)
4 users (show)

See Also:


Attachments
Fix for master (deleted)
2015-07-14 07:16 UTC, Amitay Isaacs
no flags Details
Patch for master (1.15 KB, patch)
2015-07-14 07:48 UTC, Amitay Isaacs
vl: review+
Details
Patch for v4-2 branch (1.35 KB, patch)
2015-07-14 11:19 UTC, Amitay Isaacs
vl: review+
martins: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Amitay Isaacs 2015-07-14 07:10:00 UTC
CTDB recovers persistent databases using highest sequence number.

Following test code reveals that the sequence number seems to wrap.

while true ; do
    echo '"foobar" "value"' | ctdb ptrans ctdb.tdb
    echo '"foobar" ""' | ctdb ptrans ctdb.tdb
    ctdb recover
done

Searching for relevant output from CTDB shows:

ctdbd: recoverd:Pull persistent db:0x6645c6c4 from node 4 with highest seqnum:250
ctdbd: recoverd:Pull persistent db:0x6645c6c4 from node 4 with highest seqnum:252
ctdbd: recoverd:Pull persistent db:0x6645c6c4 from node 0 with highest seqnum:254
ctdbd: recoverd:Pull persistent db:0x6645c6c4 from node 4 with highest seqnum:0
ctdbd: recoverd:Pull persistent db:0x6645c6c4 from node 1 with highest seqnum:2
Comment 1 Amitay Isaacs 2015-07-14 07:16:36 UTC
Created attachment 11254 [details]
Fix for master
Comment 2 Volker Lendecke 2015-07-14 07:19:48 UTC
Comment on attachment 11254 [details]
Fix for master

What about doing a talloc_memdup instead of talloc_zero a few lines above.

Of course this patch also works! R-b: me.
Comment 3 Amitay Isaacs 2015-07-14 07:19:50 UTC
The content of attachment 11254 [details] has been deleted
Comment 4 Amitay Isaacs 2015-07-14 07:48:31 UTC
Created attachment 11255 [details]
Patch for master
Comment 5 Amitay Isaacs 2015-07-14 07:49:17 UTC
(In reply to Volker Lendecke from comment #2)

Thanks for the suggestion.  I have modified the patch and added your r-b.
Comment 6 Amitay Isaacs 2015-07-14 11:19:05 UTC
Created attachment 11256 [details]
Patch for v4-2 branch
Comment 7 Amitay Isaacs 2015-07-15 07:34:13 UTC
Hi Karolin,

Defect fix for 4.2 branch.
Comment 8 Karolin Seeger 2015-07-16 09:44:50 UTC
(In reply to Amitay Isaacs from comment #7)
Pushed to autobuild-v4-2-test.
Comment 9 Karolin Seeger 2015-07-21 14:41:08 UTC
(In reply to Karolin Seeger from comment #8)
Pushed to v4-2-test.
Closing out bug report.

Thanks!