forked from microsoft/FluidFramework
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update pause/resume logic for doc lambdas (microsoft#23757)
## Description Update pause/resume logic for doc lambdas to make it simpler: (Previous PR for context: microsoft#23138) 1. During a pause event, the kafka consumer will be paused at the lowest offset of all doc's lastSuccessfulOffset to ensure no missing messages during resume. Earlier we were using head, but in that case some messages might get lost if they were not completely processed when pausing. 2. Made some updates to account for the use case where there are multiple doc partitions in a single kafka partition and only one of them (or few of them, but not all) triggered pause. - In this case, all the doc partitions will be updated to a paused state during pause, so that all of them can be resumed and allowed to reprocess ops during resume. - Simplified the resume logic by removing resumeBackToOffset variable and reprocessing range, and the doc partitions will now be resumed from the first offset that is > its tail (checkpointed offset). 3. Updated the asserts in createContext and checkpointing logic, to account for edge cases where the context manager's head is resumed but tail is still pending to be updated. 4. Improved readability by changing headUpdatedAfterResume and tailUpdatedAfterResume to headPaused and tailPaused to track whether head/tail has been updated after a pause/resume event. 5. Some cleanup and logging udpates. 6. Changes to not emit error from document context if it is already closed. 7. Changes to restart the service if the error.shouldRestart = true in document partition, so that any error in setting up the circuit breaker during lambda.create restarts the service instead of marking the doc as corrupt. ## Reviewer Guidance I tested with opbackup2 (draft PR: https://msazure.visualstudio.com/One/_git/FRS/pullrequest/11660231) - There are a lot of edge cases with document lambdas, and hence we will enable it slowly in each ring. --------- Co-authored-by: Shubhangi Agarwal <[email protected]>
- Loading branch information
1 parent
0aeab62
commit d63f674
Showing
7 changed files
with
188 additions
and
121 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
Oops, something went wrong.