Fix partitioned session window bug during checkpoint restore#143
Open
Fix partitioned session window bug during checkpoint restore#143
Conversation
| else if (!this.orderedKeysDictionary.ContainsKey(partitionKey)) | ||
| { | ||
| this.orderedKeysDictionary.Add(partitionKey, new LinkedList<TKey>()); | ||
| } |
Contributor
There was a problem hiding this comment.
Please add comments to explain why this is necessary - e.g., orderedKeysDictionary is not included in checkpoint, so needs to be restored, and every entry in the other collections also needs to be present in orderedKeysDictionary upon restore as that assumption is made throughout this class, etc. #Closed
Sources/Test/SimpleTesting/Partitioned/PartitionedStreamCheckpointTests.cs
Outdated
Show resolved
Hide resolved
4f85e22 to
4d86cf2
Compare
| namespace SimpleTesting | ||
| { | ||
| /* This test case verifies fix for | ||
| * Bug 944724: Exception in Trill SessionWindow when Partition (substreams) is used and restored from checkpoint |
Contributor
There was a problem hiding this comment.
944724 [](start = 11, length = 6)
944724 [](start = 11, length = 6)
Since this is GitHub repo please do not reference internal bugs, just describe them if needed #Closed
…iggers an exception.
Cause of the Issue:
The PartitionedSessionWindowPipe keeps multiple dictionary states.
One of the dictionary does not have a [DataMember] attribute, Because the value type is a LinkedList which does not support serialization.
On checkpoint and then Restore, this dictionary is re-created using other data members in UpdatePointers callback.
During this, the scenario of empty LinkedList value is missed and not restored.
When next data event appears for the partition, the partitionKey is indexed on the dictionary resulting in KeyNotFoundException
Regression
No, this existed for a long time. The customer hit the bug now because of workaround suggested (for another bug) to use 'timestamp by .. over' clause.
ReproSteps:
Added as a Testcase.
Fix:
Added code to restore key with empty LinkedList.
Verified that this was the exact state just before checkpoint.
Added a testcase that triggers this bug and with the fix the testcase passes.
4d86cf2 to
58496b0
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix partitioned session window bug, where restoring from checkpoint triggers exception