Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clone: fix race condition that may skip some SST files (#1274)
Summary: A donor thread in the main copy loop took a file to send, released the donor state mutex, and then opened the file. If an ENOENT was received at this point, it was assumed that this was a stale SST file from an older checkpoint that was rolled since. Because the donor state mutex was released between taking of the file and opening it, the following race was possible: 1) Thread 1 takes the file 2) Thread 2 decides to roll the checkpoint, the old checkpoint is deleted 3) Thread 1 tries to open the file, gets ENOENT 4) Thread 2 creates the new checkpoint, the file re-appears, but it's too late. Rolling the checkpoint in a donor state mutex critical section is a possible fix, but such section would do a lot of I/O, serializing the parallel threads. Instead, fix by taking the file and opening it in the same critical section. Pull Request resolved: #1274 Reviewed By: sunshine-Chun Differential Revision: D43629546 Pulled By: hermanlee fbshipit-source-id: 6e7f315
- Loading branch information