rocksdb/utilities/checkpoint
Andrew Kryczka 0cdaa1a804 Fix WAL corruption from checkpoint/backup race condition
Summary:
`Writer::WriteBuffer` was always called at the beginning of checkpoint/backup. But that log writer has no internal synchronization, which meant the same buffer could be flushed twice in a race condition case, causing a WAL entry to be duplicated. Then subsequent WAL entries would be at unexpected offsets, causing the 32KB block boundaries to be overlapped and manifesting as a corruption.

This PR fixes the behavior to only use `WriteBuffer` (via `FlushWAL`) in checkpoint/backup when manual WAL flush is enabled. In that case, users are responsible for providing synchronization between WAL flushes. We can also consider removing the call entirely.
Closes https://github.com/facebook/rocksdb/pull/3603

Differential Revision: D7277447

Pulled By: ajkr

fbshipit-source-id: 1b15bd7fd930511222b075418c10de0aaa70a35a
2018-03-14 16:12:50 -07:00
..
checkpoint_impl.cc Fix WAL corruption from checkpoint/backup race condition 2018-03-14 16:12:50 -07:00
checkpoint_impl.h Change RocksDB License 2017-07-15 16:11:23 -07:00
checkpoint_test.cc fix handling of empty string as checkpoint directory 2018-02-20 16:44:00 -08:00