Skip to content

Commit

Permalink
Fix bug in shouldRetry with closed linked cursor
Browse files Browse the repository at this point in the history
When we discover, via shouldretry, that a cursor needs to retry, the retry will
cascade to all linked cursors, if any.
If the cursor has previously had a linked cursor, but the linked cursor was
closed, then the parent cursor is not notified and will still traverse through
the closed linked cursor when starting retry.
This would cause the startRetry to throw a NullPointerException, because
a closed cursor drops its reference to the MuninnPagedFile.
The bug is fixed by checking that the pinned page ref is still valid, which is
the standard way of telling whether a cursor has been closed or not.
This issue was discovered by GBPTreeConcurrencyIT, which deterministically
failed.
PageCacheTests have been added in a different PR because I wanted them to go
into 3.2, instead of 3.3.
  • Loading branch information
chrisvest committed May 26, 2017
1 parent 5ad3dd9 commit dd91ee6
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@ private void startRetryLinkedChain() throws IOException
MuninnReadPageCursor cursor = this;
do
{
cursor.startRetry();
if ( cursor.pinnedPageRef != 0 )
{
cursor.startRetry();
}
cursor = (MuninnReadPageCursor) cursor.linkedCursor;
}
while ( cursor != null );
Expand Down

0 comments on commit dd91ee6

Please sign in to comment.