Mike Kolupaev fe09a6dae3 [wal changes 2/3] write with sync=true syncs previous unsynced wals to prevent illegal data loss
Summary:
I'll just copy internal task summary here:

"
This sequence will cause data loss in the middle after an sync write:

non-sync write key 1
flush triggered, not yet scheduled
sync write key 2
system crash

After rebooting, users might see key 2 but not key 1, which violates the API of sync write.

This can be reproduced using unit test FaultInjectionTest::DISABLED_WriteOptionSyncTest.

One way to fix it is for a sync write, if there is outstanding unsynced log files, we need to syc them too.
"

This diff should be considered together with the next diff D40905; in isolation this fix probably could be a little simpler.

Test Plan: `make check`; added a test for that (DBTest.SyncingPreviousLogs) before noticing FaultInjectionTest.WriteOptionSyncTest (keeping both since mine asserts a bit more); both tests fail without this diff; for D40905 stacked on top of this diff, ran tests with ASAN, TSAN and valgrind

Reviewers: rven, yhchiang, IslamAbdelRahman, anthony, kradhakrishnan, igor, sdong

Reviewed By: sdong

Subscribers: dhruba

Differential Revision: https://reviews.facebook.net/D40899
2015-07-22 03:28:08 -07:00
..
2015-07-17 18:59:11 +02:00
2015-07-17 12:02:52 -07:00
2015-07-20 17:20:40 -07:00
2015-07-15 11:25:10 -07:00
2015-07-17 18:59:11 +02:00
2015-07-17 18:59:11 +02:00
2015-07-21 21:33:20 -07:00
2015-07-20 17:20:40 -07:00
2015-04-23 12:10:36 -07:00
2015-03-17 14:08:00 -07:00
2015-01-26 11:48:07 -08:00
2015-07-07 12:10:10 -07:00
2015-07-07 12:10:10 -07:00
2015-04-27 20:23:50 -07:00
2015-03-30 16:05:35 -04:00
2015-03-17 14:08:00 -07:00
2015-02-06 08:44:30 -08:00
2015-07-21 21:33:20 -07:00
2015-07-21 21:33:20 -07:00
2015-07-20 17:20:40 -07:00
2014-11-10 17:39:38 -05:00
2015-05-29 14:36:35 -07:00