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

Failure to restore data from a failed/incomplete backup

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Fix
    • Major
    • 2.0
    • None
    • tools
    • Security Level: Public
    • Ubuntu, Single Node
      Branch - 1.8.1 - 753

    Description

      Issue
      -----------------------------------------------------------------------------------------------------
      Cannot restore of data from a failed backup. On issuing a cbrestore command, the .wal file size shrinks to 0 and restore is not able to read any data to complete the restore operation
      and throws this error -
      ------------------------------------------------------------------------------------------------------
      Traceback (most recent call last):
      File "/opt/couchbase/lib/python/cbrestore", line 250, in <module>
      main()
      File "/opt/couchbase/lib/python/cbrestore", line 185, in main
      db.executemany("attach ? as ?", zip(db_filenames, attached_dbs))
      sqlite3.OperationalError: too many attached databases - max 10
      ------------------------------------------------------------------------------------------------------

      Steps to reproduce
      ------------------------------------------------------------------------------------------------------
      Load 1M of data : [/opt/couchbase/bin/memcachetest -h localhost:11211 -i 1000000 -M 1024 -K cb_2 -l ]
      Run a backup of the data [ while database is online] : sudo -su couchbase /opt/couchbase/bin/cbbackup /opt/couchbase/var/lib/couchbase/data/default-data/default /tmp/rev7
      Copy data from /../default-data to backup folder - [ cp -r /opt/couchbase/var/lib/couchbase/data/default-data/ /tmp/rev7/*]
      Run a restore [sudo /opt/couchbase/bin/cbrestore -H localhost:11211 /tmp/rev7/default*]

      Error
      ------------------------------------------------------------------------------------------------------
      Traceback (most recent call last):
      File "/opt/couchbase/lib/python/cbrestore", line 250, in <module>
      main()
      File "/opt/couchbase/lib/python/cbrestore", line 185, in main
      db.executemany("attach ? as ?", zip(db_filenames, attached_dbs))
      sqlite3.OperationalError: too many attached databases - max 10

      ls -lt -h /tmp/rev7/*

      Before Restore
      -----------------------------
      rw-rr- 1 ketaki ketaki 13M 2012-04-17 09:21 /tmp/rev7/default-wal
      rw-rr- 1 ketaki ketaki 128K 2012-04-17 09:21 /tmp/rev7/default-shm
      rw-rr- 1 ketaki ketaki 824M 2012-04-17 09:21 /tmp/rev7/default-3.mb-wal
      rw-rr- 1 ketaki ketaki 6.4M 2012-04-17 09:21 /tmp/rev7/default-3.mb-shm
      -rwxrwxrwx 1 couchbase couchbase 477M 2012-04-17 09:21 /tmp/rev7/default-3.mb
      rw-rr- 1 ketaki ketaki 820M 2012-04-17 09:21 /tmp/rev7/default-2.mb-wal
      rw-rr- 1 ketaki ketaki 6.3M 2012-04-17 09:21 /tmp/rev7/default-2.mb-shm
      -rwxrwxrwx 1 couchbase couchbase 478M 2012-04-17 09:21 /tmp/rev7/default-2.mb
      rw-rr- 1 ketaki ketaki 821M 2012-04-17 09:20 /tmp/rev7/default-1.mb-wal
      rw-rr- 1 ketaki ketaki 6.3M 2012-04-17 09:20 /tmp/rev7/default-1.mb-shm
      -rwxrwxrwx 1 couchbase couchbase 477M 2012-04-17 09:20 /tmp/rev7/default-1.mb
      rw-rr- 1 ketaki ketaki 820M 2012-04-17 09:20 /tmp/rev7/default-0.mb-wal
      rw-rr- 1 ketaki ketaki 6.3M 2012-04-17 09:20 /tmp/rev7/default-0.mb-shm
      -rwxrwxrwx 1 couchbase couchbase 477M 2012-04-17 09:20 /tmp/rev7/default-0.mb
      -rwxrwxrwx 1 couchbase couchbase 1.0K 2012-04-17 09:20 /tmp/rev7/default

      After issuing restore
      ------------------------------
      ketaki@ubu-0101:/opt/couchbase$ ls -lt /tmp/rev7/*
      -rwxrwxrwx 1 couchbase couchbase 499994624 2012-04-17 09:26 /tmp/rev7/default-3.mb
      rw-rr- 1 ketaki ketaki 6619136 2012-04-17 09:26 /tmp/rev7/default-3.mb-shm
      rw-rr- 1 root root 0 2012-04-17 09:25 /tmp/rev7/default-2.mb-shm
      rw-rr- 1 root root 0 2012-04-17 09:25 /tmp/rev7/default-2.mb-wal
      -rwxrwxrwx 1 couchbase couchbase 545611776 2012-04-17 09:25 /tmp/rev7/default-2.mb
      rw-rr- 1 root root 0 2012-04-17 09:25 /tmp/rev7/default-1.mb-shm
      rw-rr- 1 root root 0 2012-04-17 09:25 /tmp/rev7/default-1.mb-wal
      -rwxrwxrwx 1 couchbase couchbase 545002496 2012-04-17 09:24 /tmp/rev7/default-1.mb
      rw-rr- 1 root root 0 2012-04-17 09:24 /tmp/rev7/default-0.mb-shm
      rw-rr- 1 root root 0 2012-04-17 09:24 /tmp/rev7/default-0.mb-wal
      -rwxrwxrwx 1 couchbase couchbase 544702464 2012-04-17 09:24 /tmp/rev7/default-0.mb
      -rwxrwxrwx 1 couchbase couchbase 52224 2012-04-17 09:23 /tmp/rev7/default
      rw-rr- 1 ketaki ketaki 863795168 2012-04-17 09:21 /tmp/rev7/default-3.mb-wal
      ------------------------------------------------------------------------------------------------------

      ------------------------------------------------------------------------------------------------------

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            bcui Bin Cui (Inactive)
            ketaki Ketaki Gangal (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty