I'm making a Flask app with rocksdb as the key-value store. I'm able to create and add to the database when I run the app once, but on restarting the app, I get this error:
rocksdb.errors.Corruption: b"Corruption: Can't access /000010.sst: IO error: No such file or directorywhile stat a file for size: database_name.db/000010.sst: No such file or directory\n"
I tried the answer from this link: rocksdb.errors.RocksIOError: IO error: While lock file: sample.db/LOCK: Resource temporarily unavailable but it didn't help.
This is the code:
opts = rocksdb.Options()
opts.create_if_missing = True
opts.wal_dir = absolute path to database
opts.db_log_dir = absolute path to database
opts.wal_ttl_seconds = 100
os.system('rm database_name.db/LOCK')
database_name_db = rocksdb.DB('database_name.db', opts)