Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-31517

Cbbackup accumulative backup always performs a full backup after the first accumulative backup

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 6.0.3, 6.5.0
    • 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
    • tools
    • 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

      1. Create beer-sample bucket, observe there are 7303 items in the bucket
      2. 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)
        

      3. 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
        

      4. Create a new document, test1 in the Couchbase Server UI (or however you'd like). There are now 7304 items in the bucket.
      5. 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)
        

      6. 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
        

      7. Create a new document in the same bucket, test2
      8. 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

          For Gerrit Dashboard: MB-31517
          # Subject Branch Project Status CR V

          Activity

            People

              carlos.gonzalez Carlos Gonzalez Betancort (Inactive)
              matt.carabine Matt Carabine (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty