-
Notifications
You must be signed in to change notification settings - Fork 230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drop support for databases repair attempt. #666
Comments
Hey @ytrezq Here are some questions and thoughts:
|
@ordian the problem is kvdb-rocksdb attempt repairs automatically https://github.com/paritytech/parity-common/blob/master/kvdb-rocksdb/src/lib.rs#L326 regardless of the number of columns which results in deleting all columns in the Manifest and thus doing more harm than good. |
So you're saying that
|
@ordain this is a well known issue upstream. The underlying logic comes from the leveldb era. Those functions are no longer in use at Facebook. |
@ytrezq could you be more specific which issue is it? Do you have a link or a repro test case?
Which is mentioned in facebook/rocksdb#5073. The reason I ask is there are tests for RepairDB for multiple columns: https://github.com/facebook/rocksdb/blob/b16655a547c3a44f8dcbe09614ef7ebb8daa83ac/db/repair_test.cc#L306. And if those functions are no longer in use at Meta, do you happen to know what they use instead? |
@ordian : Delete the manifest file of a properly shut down https://github.com/paritytech/polkadot database ; let the database to be rebuilt at next run ; Then, https://github.com/paritytech/parity-common/blob/master/kvdb-rocksdb/src/lib.rs#L337 is triggered beacause the database contains only 1 column. |
The database won't be repaired if the
When deleting both |
@ordian : by |
Sorry, my bad. The recovery attempt only happens if
results in a corrupted manifest file. I'll submit a PR to remove the repairer attempt. Thanks for letting us know and bearing with me :) |
@ordian : better. In the case of a corrupt crc32 on an entry, rewrite the crc or delete the entry so Polkadot or Openethereum can use the database again. |
@ordian : an even better approach would be to bring multi column supports upstream. |
@ytrezq our even better approach is replace RocksDB with https://github.com/paritytech/parity-db long-term ;) |
This comes from openethereum/openethereum#264.
Currently, if the database is corrupted, kvdb-Rocksdb will attempt to repair it using the code from leveldb.
As the code only works on single column databases, it’s no longer effective and just lur users into possible rescue which won’t happen. This should be removed and replaced with an option to trim the database (from the beginning to the specified block possibly the latest valid block in the case of sst corruption).
The text was updated successfully, but these errors were encountered: