This repository has been archived by the owner on Sep 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 311
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Kestrel replay fix - Part 1: Problem: The pack request is triggered by the fillReadBehind where as the journal.remove updates removesSinceReadBehind after the fillReadBehind call. This ordering leaves two windows in which either we will lose an item or deliver an extra (potentially dummy/invalid item). This change addresses the problem as follows 1. In the normal mode - fillReadBehind is called after the remove has already been logged in the journal - this makes sure that the removesSinceReadBehind count has already been updated to reflect the fact that the current item has been removed from the in-memory queue which is used as the source of the pack. The same is done for the discard/expiration workflows 2. In the replay mode - Since journal removes are already logged (or are not being newly logged) the fillReadBehind is done as before. 3. The pack logic calls a fsync on the journal file before the packed file replaces the old journal files on disk to ensure that the removes that were accounted for in the pack have been indeed logged in the journal. 4. The change to PersistentQueue#setup is just for the tests This doesn't fully address KEST-402. However this is necessary for the second part of the fix. RB_ID=121133
- Loading branch information
Showing
5 changed files
with
74 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters