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

forestdb_dump crashed when opens an fdb file in backup repo

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Not a Bug
    • 6.5.0
    • 6.5.0
    • forestdb
    • Centos 7.5 64-bit
    • Untriaged
    • Centos 64-bit
    • Yes

    Description

      Install Couchbase server 6.5.0-2158 on 4 centos 7.5 servers (224, 225, 226, 227).
      Create a default bucket on node 224.
      Load 1000 docs to default bucket.
      On node 227, backup data from node 224 to /tmp/entbackup
      On node 226, create default bucket.
      On node 227, restore data to node 226
      To compare backup data in backup repo and data on restore node, I use forestdb_dump in /opt/couchbase/bin to extract data from backup repo, the extraction failed due to crash on shard_9.fdb

      [root@s44018 ~]# /opt/couchbase/bin/forestdb_dump --plain-meta /tmp/entbackup/backup/201*/default*/data/shard_*.fdb 
      2019-01-28T21:36:00.936-08:00 [ERRO][FDB] Crash Detected: Last Block not DBHEADER ff in a database file '/tmp/entbackup/backup/2019-01-28T21_07_56.041313113-08_00/default-e875fa27b05c03256741bc2937cae764/data/shard_9.fdb'
       
      2019-01-28T21:36:00.936-08:00 [INFO][FDB] Forestdb opened database file /tmp/entbackup/backup/2019-01-28T21_07_56.041313113-08_00/default-e875fa27b05c03256741bc2937cae764/data/shard_9.fdb
      DB header info:
          No header exists.
          DB file version: ForestDB v2.x format
      2019-01-28T21:36:00.937-08:00 [INFO][FDB] Forestdb closed database file /tmp/entbackup/backup/2019-01-28T21_07_56.041313113-08_00/default-e875fa27b05c03256741bc2937cae764/data/shard_9.fdb
      [root@s44018 ~]# 
      [root@s44018 ~]# 
      [root@s44018 ~]# 
      [root@s44018 ~]# /opt/couchbase/bin/forestdb_dump --plain-meta /tmp/entbackup/backup/201*/default*/data/shard_9.fdb 
      2019-01-28T21:36:08.774-08:00 [ERRO][FDB] Crash Detected: Last Block not DBHEADER ff in a database file '/tmp/entbackup/backup/2019-01-28T21_07_56.041313113-08_00/default-e875fa27b05c03256741bc2937cae764/data/shard_9.fdb'
       
      2019-01-28T21:36:08.775-08:00 [INFO][FDB] Forestdb opened database file /tmp/entbackup/backup/2019-01-28T21_07_56.041313113-08_00/default-e875fa27b05c03256741bc2937cae764/data/shard_9.fdb
      DB header info:
          No header exists.
          DB file version: ForestDB v2.x format
      2019-01-28T21:36:08.776-08:00 [INFO][FDB] Forestdb closed database file /tmp/entbackup/backup/2019-01-28T21_07_56.041313113-08_00/default-e875fa27b05c03256741bc2937cae764/data/shard_9.fdb
      [root@s44018 ~]# 
      
      

      Attachments

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

        Activity

          srinath.duvuru Srinath Duvuru added a comment - - edited

          Thuan Nguyen Arunkumar Senthilnathan The dump utility is not crashing, it is reporting an error. The forestdb_dump utility expects the file passed in to be a valid forestdb file. The dump utility opens the forestdb file and sees the end of the file is not a header. The only way a "valid" forestdb file can get to that state is if a had crash occured. The dump utility reports the file to be dumped must be a result of a crash as there is a missing header.

          Is it possible to call forestdb_dump on files that are expected to be initialized forestdb files?  If there is a need to pass in uninitialized forestdb files, the caller can ignore the error reported.

          srinath.duvuru Srinath Duvuru added a comment - - edited Thuan Nguyen Arunkumar Senthilnathan  The dump utility is not crashing, it is reporting an error. The forestdb_dump utility expects the file passed in to be a valid forestdb file. The dump utility opens the forestdb file and sees the end of the file is not a header. The only way a "valid" forestdb file can get to that state is if a had crash occured. The dump utility reports the file to be dumped must be a result of a crash as there is a missing header. Is it possible to call forestdb_dump on files that are expected to be initialized forestdb files?  If there is a need to pass in uninitialized forestdb files, the caller can ignore the error reported.

          Thuan Nguyen  Arunkumar Senthilnathan Please let me know if forestdb change is needed or can be handled outside. To reiterate, the dump command is not crashing, it is merely reporting the file is not in the expected format and a crash left it in that unclean state.

          srinath.duvuru Srinath Duvuru added a comment - Thuan Nguyen   Arunkumar Senthilnathan Please let me know if forestdb change is needed or can be handled outside. To reiterate, the dump command is not crashing, it is merely reporting the file is not in the expected format and a crash left it in that unclean state.

          Srinath Duvuru forestdb_dump stopped when it reads an empty file. Is it possible forestdb_dump skip the empty file and continue to run the next file in data directory?

          thuan Thuan Nguyen added a comment - Srinath Duvuru forestdb_dump stopped when it reads an empty file. Is it possible forestdb_dump skip the empty file and continue to run the next file in data directory?

          Thuan Nguyen  forestdb_dump does not loop through the files. The shell uses the * to match to the first file and runs dump on it.

          If you want to run through all the files you'll need some script like this

           

          for filename in shard*; do
             forestdb_dump "$filename"
          done
          

           

          srinath.duvuru Srinath Duvuru added a comment - Thuan Nguyen   forestdb_dump does not loop through the files. The shell uses the * to match to the first file and runs dump on it. If you want to run through all the files you'll need some script like this   for filename in shard*; do    forestdb_dump "$filename" done  

          Updated test codes to extract data from shard*.fdb using forestdb_dump in CBQE-4889

          thuan Thuan Nguyen added a comment - Updated test codes to extract data from shard*.fdb using forestdb_dump in CBQE-4889

          People

            srinath.duvuru Srinath Duvuru
            thuan Thuan Nguyen
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty