Yanqin Jin
201c5a5e61
Fail recovery when MANIFEST record checksum mismatch ( #6996 )
...
Summary:
https://github.com/facebook/rocksdb/issues/5411 refactored `VersionSet::Recover` but introduced a bug, explained as follows.
Before, once a checksum mismatch happens, `reporter` will set `s` to be non-ok. Therefore, Recover will stop processing the MANIFEST any further.
```
// Correct
// Inside Recover
LogReporter reporter;
reporter.status = &s;
log::Reader reader(..., reporter);
while (reader.ReadRecord() && s.ok()) {
...
}
```
The bug is that, the local variable `s` in `ReadAndRecover` won't be updated by `reporter` while reading the MANIFEST. It is possible that the reader sees a checksum mismatch in a record, but `ReadRecord` retries internally read and finds the next valid record. The mismatched record will be ignored and no error is reported.
```
// Incorrect
// Inside Recover
LogReporter reporter;
reporter.status = &s;
log::Reader reader(..., reporter);
s = ReadAndRecover(reader, ...);
// Inside ReadAndRecover
Status s; // Shadows the s in Recover.
while (reader.ReadRecord() && s.ok()) {
...
}
```
`LogReporter` can use a separate `log_read_status` to track the errors while reading the MANIFEST. RocksDB can process more MANIFEST entries only if `log_read_status.ok()`.
Test plan (devserver):
make check
Pull Request resolved: https://github.com/facebook/rocksdb/pull/6996
Reviewed By: ajkr
Differential Revision: D22105746
Pulled By: riversand963
fbshipit-source-id: b22f717a423457a41ca152a242abbb64cf91fc38
2020-06-19 14:32:19 -07:00
..
2020-04-23 13:44:29 -07:00
2020-05-08 09:02:10 -07:00
2020-06-16 14:45:57 -07:00
2020-04-15 17:40:44 -07:00
2020-03-06 16:24:27 -08:00
2020-04-15 17:40:44 -07:00
2020-03-27 16:04:43 -07:00
2020-02-18 11:18:25 -08:00
2020-04-07 14:45:39 -07:00
2020-04-21 17:38:17 -07:00
2020-03-20 19:30:48 -07:00
2020-03-20 19:30:48 -07:00
2020-02-20 12:09:57 -08:00
2020-03-02 16:01:00 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-04-29 13:09:23 -07:00
2020-06-05 11:33:59 -07:00
2020-02-20 12:09:57 -08:00
2020-06-19 14:32:19 -07:00
2020-04-27 13:20:27 -07:00
2020-06-03 20:11:16 -07:00
2020-02-20 12:09:57 -08:00
2020-04-20 13:24:25 -07:00
2020-04-20 13:24:25 -07:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-04-15 17:40:44 -07:00
2020-04-10 09:51:58 -07:00
2020-04-15 17:40:44 -07:00
2020-02-20 12:09:57 -08:00
2020-03-20 15:26:10 -07:00
2020-03-02 16:01:00 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-04-30 17:01:17 -07:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-05-08 10:11:04 -07:00
2020-02-20 12:09:57 -08:00
2020-04-10 15:30:38 -07:00
2020-02-20 12:09:57 -08:00
2020-05-08 08:51:41 -07:00
2020-05-08 10:11:04 -07:00
2020-05-08 10:11:04 -07:00
2020-04-20 13:24:25 -07:00
2020-05-08 09:02:10 -07:00
2020-03-05 17:18:16 -08:00
2020-04-27 22:49:56 -07:00
2020-04-10 16:05:49 -07:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-03-06 16:24:27 -08:00
2020-03-06 16:24:27 -08:00
2020-02-20 12:09:57 -08:00
2020-04-03 10:26:49 -07:00
2020-03-28 19:07:25 -07:00
2020-03-27 16:04:43 -07:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-02-25 15:31:48 -08:00
2020-03-02 16:16:26 -08:00
2020-02-20 12:09:57 -08:00
2020-04-08 21:22:15 -07:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-04-07 16:00:26 -07:00
2020-03-31 12:11:42 -07:00
2020-03-27 16:04:43 -07:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-04-15 17:40:44 -07:00
2020-04-15 17:40:44 -07:00
2020-04-30 08:40:42 -07:00
2020-02-20 12:09:57 -08:00
2020-04-16 13:16:06 -07:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-04-30 11:25:51 -07:00
2020-03-12 11:00:56 -07:00
2020-02-20 12:09:57 -08:00
2020-04-20 13:24:25 -07:00
2020-04-20 11:39:31 -07:00
2020-02-20 12:09:57 -08:00
2020-06-19 14:32:19 -07:00
2020-03-27 16:04:43 -07:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-03-04 20:15:25 -08:00
2020-03-27 16:04:43 -07:00
2020-03-27 16:04:43 -07:00
2020-03-27 16:04:43 -07:00
2020-04-20 13:24:25 -07:00
2020-03-02 16:01:00 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-04-20 13:24:25 -07:00
2020-02-20 12:09:57 -08:00
2020-03-11 12:33:45 -07:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-04-15 17:40:44 -07:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-04-29 13:09:23 -07:00
2020-04-21 13:16:31 -07:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-05-08 12:50:31 -07:00
2020-05-08 08:51:41 -07:00
2020-04-30 11:25:51 -07:00
2020-06-19 14:32:19 -07:00
2020-06-19 14:32:19 -07:00
2020-03-23 10:27:47 -07:00
2020-03-23 10:27:47 -07:00
2020-03-23 10:27:47 -07:00
2020-05-08 10:02:02 -07:00
2020-06-19 14:32:19 -07:00
2020-06-19 14:32:19 -07:00
2020-02-20 12:09:57 -08:00
2020-04-29 13:09:23 -07:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-04-29 13:09:23 -07:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-02-28 14:14:03 -08:00
2020-02-20 12:09:57 -08:00