rocksdb icon indicating copy to clipboard operation
rocksdb copied to clipboard

rocksdb restart failed

Open panda-sheep opened this issue 2 years ago • 5 comments

Note: Please use Issues only for bug reports. For questions, discussions, feature requests, etc. post to dev group: https://groups.google.com/forum/#!forum/rocksdb or https://www.facebook.com/groups/rocksdb.dev

Expected behavior

restart successfully

Actual behavior

restart failed

Steps to reproduce the behavior

1) stop rocksdb 2) move the rocksdb data 3) open rocksdb with the same path, the following error will be reported: Check failed: status.ok() Corruption: Corruption: IO error: No such file or directory: While open a file for random read: xxxx/data/000017. ldb: No such file or directory

panda-sheep avatar Jul 13 '22 08:07 panda-sheep

This step seems problematic: "2) move the rocksdb data". Why would the DB be openable if the data is moved?

ajkr avatar Jul 13 '22 16:07 ajkr

This step seems problematic: "2) move the rocksdb data". Why would the DB be openable if the data is moved?

I am using rocksdb for restore operation. Before doing restore, I do the following:

  1. move the data directory and rename it to data.bak
  2. Then start a new rocksdb with the same path(before starting, we created the data directory), then ingest the backed up sst file
  3. If the second step fails, use the first step data.bak to restore the state before restore

The problem is the second step, use the same path to start a new rocksdb. Starting rocksdb failed, throwing the error below:

Check failed: status.ok() Corruption: Corruption: IO error: No such file or directory: While open a file for random read: xxxx/data/000017.ldb: No such file or directory

panda-sheep avatar Jul 14 '22 03:07 panda-sheep

Then start a new rocksdb with the same path(before starting, we created the data directory), then ingest the backed up sst file

Only SST files generated by SstFileWriter can be ingested via DB::IngestExternalFile() APIs.

riversand963 avatar Jul 19 '22 17:07 riversand963

Then start a new rocksdb with the same path(before starting, we created the data directory), then ingest the backed up sst file

Only SST files generated by SstFileWriter can be ingested via DB::IngestExternalFile() APIs.

yeah. But before I ingest the sst file, starting an empty rocksdb fails. The ingest sst file has not been executed yet.

panda-sheep avatar Jul 19 '22 23:07 panda-sheep

Maybe strace the process to find out what are the paths for the CURRENT file and MANIFEST file it is reading during step two? It must be reading a MANIFEST at least considering it expects a table file number 17 to exist.

ajkr avatar Jul 20 '22 22:07 ajkr

@ajkr I had the same problem,ldb repair --db=/opt/data ,later,can to get data, but not put data

[15:05:15.380] [ERROR] com.supcon.kvdb.server.rocksdb.RocksDbClient.initRocksdb(RocksDbClient.java:184) - RocksDB init failure!! error:Corruption: IO error: No such file or directory: While open a file for random read: /opt/data/007500.sst: No such file or directory The file /opt/data/MANIFEST-007502 may be corrupted. org.rocksdb.RocksDBException: Corruption: IO error: No such file or directory: While open a file for random read: /opt/data/007500.sst: No such file or directory The file /opt/data/MANIFEST-007502 may be corrupted.

NNSJ avatar Mar 28 '24 08:03 NNSJ