Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Guard for nodes being reused while pinned by SeekCursor A SeekCursor can read unexpected data caused by node page being reused in two cases: 1. The page currently pinned is reused -> node will have a changed generation. 2. The page is reused after reading a pointer to it but before "landing" on it -> node will have a generation larger than that of the followed pointer. We now guard for this by verifying that generation of node is not larger than the generation of the pointer that was followed to reach the node and by verifying that the generation of the node does not change during the SeekCursor's visit. IF such a generaton abnormailty is observerd, the seek is restarted from the root with an updated range starting from the previously returned key. Note that it IS valid for node generation to be lower than the followed pointer generation because the generation of the pointer is updated when we copy if from an older node, e.g. rightSibling of right node in a split. ConsistenctChecker is also updated with this generation verification. - verifyGen is no longer done in TreeNode.goTo for two reasons: 1. Reading generation field here is not valid because it is not always guarded by a shouldRetry or a write lock. 2. The assumption that pointer generation always match generation of the node that it points to is false. The correct assumption is that the node generation can not be larger than the pointer generation. - verifyType is no longer done in TreeNode.goTo. See reason nr1 above. - SeekCursor now reread keyCount on every call to next Previously weird behaviour was observed where the keyCount was not updated propery. The reason why is unclear but re-reading it every time also reduse complexity. Win. - Fixes issue with rediscovering key in SeekCursor where there would be a need to rediscover key due to read key being too far to the left and no result had been returned yet. Previously this would just set pos to 0. This would be a problem being too far to the left because this would result in an endless loop where the cursor would never leave the node and never leave the next() either. Other changes: - Add very aggressive read concurrency test - Extract long running tests from GBPTreeTest to GBPTreeIT - Add possibility to not print values in TreePrinter - Fix TreePrinter to extract pointer value using GSPP
- Loading branch information
Showing
16 changed files
with
1,130 additions
and
486 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
Oops, something went wrong.