Details
-
Bug
-
Resolution: Fixed
-
Major
-
5.0.0, 5.0.1, 5.1.0, 5.1.1, 5.1.2, 5.5.0, 5.5.1, 6.0.0, 6.0.1, 6.0.2
-
Untriaged
-
Yes
Description
Semi-related to MB-31515, in Couchbase Server 5.x onwards all accumulative backups after the first one revert to a full backup.
Reproduction
- Create beer-sample bucket, observe there are 7303 items in the bucket
- Create an 'accumulative' backup of the beer-sample bucket, this should just be a full backup as the archive does not exist yet
$ /opt/couchbase/bin/cbbackup http://localhost:8091 /backup -m accu -u Administrator -p password
[####################] 100.0% (7303/estimated 7303 msgs)
- Verify the number of items in the backup is 7303 (total docs in the sample bucket)
$ sqlite3 /backup/2018-10-04T154506Z/2018-10-04T154506Z-full/bucket-beer-sample/node-127.0.0.1%3A8091/data-0000.cbb 'SELECT count(key) FROM cbb_msg WHERE length(val) != 0'
7303
- Create a new document, test1 in the Couchbase Server UI (or however you'd like). There are now 7304 items in the bucket.
- Take an accumulative backup, re-using the same archive
/opt/couchbase/bin/cbbackup http://localhost:8091 /backup -m accu -u Administrator -p password
[####################] 100.0% (7304/estimated 7304 msgs)
- Verify the item count in the accumulative backup
$ sqlite3 /backup/2018-10-04T154506Z/2018-10-04T154555Z-accu/bucket-beer-sample/node-127.0.0.1%3A8091/data-0000.cbb 'SELECT count(key) FROM cbb_msg WHERE length(val) != 0'
1
- Create a new document in the same bucket, test2
- Perform another accumulative backup
$ /opt/couchbase/bin/cbbackup http://localhost:8091 /backup -m accu -u Administrator -p password
[####################] 100.0% (7305/estimated 7305 msgs)
Notice how the next accumulative has now backed up everything in the bucket, rather than performing an accumulative backup.
Repeating accumulative backups continue to create full backups each time.
From code investigation I have identified the introduction of https://github.com/couchbase/couchbase-cli/commit/84e5ece152830e74f3edc4663f2feb7d807e15dd#diff-8fa4dba26a01d131a6708d9fd437c858 caused this behavior.
The code finds the most recent accumulative directory then tries to extract the server version which for the accumulative backups seems to be "0.0.0" because it can't seem to find the right one.
This only seems to affect accumulative backups, if you just perform a full followed by a series of diffs then you do not see this behavior.
This is an issue as it means you cannot effectively use accumulative backups in Couchbase Server 5.x.
Attachments
Issue Links
Gerrit Reviews
For Gerrit Dashboard: MB-31517 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
102256,2 | MB-31517 MB-31515 Correct cbbackup accu behaviour | master | couchbase-cli | Status: MERGED | +2 | +1 |
111242,5 | MB-31517 MB-31515 Backport fix for accumulative backups | alice | couchbase-cli | Status: MERGED | +2 | +1 |
111740,1 | MB-31517 MB-31515 Merge remote-tracking branch 'couchbase/alice' | master | couchbase-cli | Status: MERGED | +2 | +1 |