Andrew Kryczka
eb65d673fe
Fix kPointInTimeRecovery handling of truncated WAL ( #7701 )
...
Summary:
WAL may be truncated to an incomplete record due to crash while writing
the last record or corruption. In the former case, no hole will be
produced since no ACK'd data was lost. In the latter case, a hole could
be produced without this PR since we proceeded to recover the next WAL
as if nothing happened. This PR changes the record reading code to
always report a corruption for incomplete records in
`kPointInTimeRecovery` mode, and the upper layer will only ignore them
if the next WAL has consecutive seqnum (i.e., we are guaranteed no
hole).
While this solves the hole problem for the case of incomplete
records, the possibility is still there if the WAL is corrupted by
truncation to an exact record boundary. This PR also regresses how much data
can be recovered when writes are mixed with/without
`WriteOptions::disableWAL`, as then we can not distinguish between a
seqnum gap caused by corruption and a seqnum gap caused by a `disableWAL` write.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/7701
Test Plan:
Interestingly there already was a test for this case
(`DBWALTestWithParams.kPointInTimeRecovery`); it just had a typo bug in
the verification that prevented it from noticing holes in recovery.
Reviewed By: anand1976
Differential Revision: D25111765
Pulled By: ajkr
fbshipit-source-id: 5e330b13b1ee2b5be096cea9d0ff6075843e57b6
2020-11-30 18:11:38 -08:00
..
2020-10-27 10:33:09 -07:00
2020-11-23 21:08:22 -08:00
2020-11-18 21:27:54 -08:00
2020-08-03 15:23:04 -07:00
2020-08-03 15:23:04 -07:00
2020-11-12 18:44:34 -08:00
2020-11-12 18:44:34 -08:00
2020-10-16 11:04:01 -07:00
2020-10-28 23:22:27 -07:00
2020-11-23 21:08:22 -08:00
2020-11-23 21:08:22 -08:00
2020-10-28 10:12:58 -07:00
2020-07-02 19:25:41 -07:00
2020-10-01 19:14:14 -07:00
2020-02-20 12:09:57 -08:00
2020-10-28 23:22:27 -07:00
2020-05-12 18:23:33 -07:00
2020-11-20 18:40:24 -08:00
2020-11-07 22:23:27 -08:00
2020-11-16 22:09:01 -08:00
2020-11-02 19:21:11 -08:00
2020-11-12 20:46:14 -08:00
2020-10-28 10:12:58 -07:00
2020-11-23 21:08:22 -08:00
2020-10-19 11:38:48 -07:00
2020-10-27 10:33:09 -07:00
2020-09-10 22:35:25 -07:00
2020-11-17 15:55:55 -08:00
2020-10-22 17:06:20 -07:00
2020-06-15 10:47:02 -07:00
2020-08-17 18:42:25 -07:00
2020-08-17 18:42:25 -07:00
2020-06-24 16:22:49 -07:00
2020-10-28 10:12:58 -07:00
2020-11-10 17:17:39 -08:00
2020-09-29 09:49:04 -07:00
2020-11-10 17:17:39 -08:00
2020-08-17 18:42:25 -07:00
2020-03-20 15:26:10 -07:00
2020-11-23 16:29:04 -08:00
2020-08-17 18:42:25 -07:00
2020-11-06 15:24:17 -08:00
2020-11-11 20:32:28 -08:00
2020-10-27 10:33:09 -07:00
2020-11-07 22:23:27 -08:00
2020-10-27 10:33:09 -07:00
2020-09-04 23:25:03 -07:00
2020-11-06 14:25:14 -08:00
2020-08-17 18:42:25 -07:00
2020-11-02 19:48:23 -08:00
2020-11-13 13:37:14 -08:00
2020-10-27 10:33:09 -07:00
2020-10-27 10:33:09 -07:00
2020-10-27 10:33:09 -07:00
2020-11-30 18:11:38 -08:00
2020-11-10 14:53:13 -08:00
2020-08-17 18:42:25 -07:00
2020-10-27 10:33:09 -07:00
2020-10-28 23:22:27 -07:00
2020-10-28 10:12:58 -07:00
2020-10-28 10:12:58 -07:00
2020-10-22 17:06:20 -07:00
2020-10-27 10:33:09 -07:00
2020-09-29 18:23:27 -07:00
2020-09-17 20:25:45 -07:00
2020-10-02 16:41:13 -07:00
2020-08-25 10:46:11 -07:00
2020-02-20 12:09:57 -08:00
2020-10-27 10:33:09 -07:00
2020-10-28 16:47:12 -07:00
2020-08-18 16:20:54 -07:00
2020-08-24 11:26:09 -07:00
2020-10-28 23:22:27 -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-10-28 23:22:27 -07:00
2020-11-23 16:29:04 -08:00
2020-11-12 18:44:34 -08:00
2020-11-12 18:44:34 -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-10-21 20:18:06 -07:00
2020-04-15 17:40:44 -07:00
2020-10-28 10:12:58 -07:00
2020-08-18 16:20:54 -07:00
2020-10-27 10:33:09 -07:00
2020-11-12 17:33:04 -08:00
2020-10-15 13:04:47 -07:00
2020-05-04 15:08:13 -07:00
2020-10-28 23:22:27 -07:00
2020-02-20 12:09:57 -08:00
2020-11-30 18:11:38 -08:00
2020-08-26 10:39:20 -07:00
2020-11-30 18:11:38 -08:00
2020-06-18 10:09:12 -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-11-23 16:29:04 -08:00
2020-11-17 15:55:55 -08:00
2020-10-26 18:23:01 -07:00
2020-11-23 16:29:04 -08:00
2020-11-23 16:29:04 -08:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-10-28 10:12:58 -07:00
2020-10-28 10:12:58 -07:00
2020-02-20 12:09:57 -08:00
2020-10-26 18:23:01 -07:00
2020-10-28 23:22:27 -07:00
2020-09-16 15:48:07 -07:00
2020-11-10 23:42:13 -08:00
2020-11-10 23:42:13 -08:00
2020-10-27 10:33:09 -07:00
2020-10-27 10:33:09 -07:00
2020-10-28 23:22:27 -07:00
2020-10-01 19:14:14 -07:00
2020-02-20 12:09:57 -08:00
2020-10-28 23:22:27 -07:00
2020-02-20 12:09:57 -08:00
2020-10-02 17:01:15 -07:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-10-28 10:12:58 -07:00
2020-10-28 10:12:58 -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-08-14 19:20:58 -07:00
2020-09-29 16:30:08 -07:00
2020-11-12 18:44:34 -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-11-03 09:45:41 -08:00
2020-08-27 11:21:52 -07:00
2020-09-14 17:01:01 -07:00
2020-10-28 10:12:58 -07:00
2020-02-20 12:09:57 -08:00
2020-08-18 16:20:54 -07:00
2020-08-12 17:31:23 -07:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-10-28 23:22:27 -07:00
2020-10-02 22:11:00 -07:00
2020-06-09 16:51:23 -07:00
2020-11-11 08:00:14 -08:00
2020-11-11 08:00:14 -08:00
2020-11-06 17:22:36 -08:00
2020-11-06 17:22:36 -08:00
2020-11-11 08:00:14 -08:00
2020-11-11 08:00:14 -08:00
2020-11-23 21:08:22 -08:00
2020-11-23 21:08:22 -08:00
2020-11-06 17:22:36 -08:00
2020-11-06 17:22:36 -08:00
2020-11-06 17:22:36 -08:00
2020-10-22 17:06:20 -07:00
2020-10-22 17:06:20 -07:00
2020-08-12 17:31:23 -07:00
2020-02-20 12:09:57 -08:00
2020-02-20 12:09:57 -08:00
2020-11-16 20:39:01 -08:00
2020-11-23 16:29:04 -08:00
2020-06-30 12:31:30 -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-10-06 12:44:20 -07:00
2020-10-14 10:47:58 -07:00