Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WT-5689 reduce work required for the cursor-pinned test. #5323

Merged
merged 1 commit into from Feb 27, 2020

Conversation

keithbostic
Copy link
Contributor

@sulabhM, this change went in as part of WT-5256, here's the commit .

Assuming your change was correct, I think we can just simplify the whole thing?

@keithbostic keithbostic self-assigned this Feb 27, 2020
Copy link
Member

@agorrod agorrod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I was going to suggest that we keep the assertion, but I don't think it's safe - the page could be temporarily flipped to locked.

* "normal" state and then test against that state (eviction may have already locked the page
* again).
*/
while ((current_state = cbt->ref->state) == WT_REF_LOCKED)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can eviction be locking the page at this point, don't we need to wait till we get a REF_MEM state.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even if we got a WT_REF_MEM state, it wouldn't be permanent, that is, it could be flipped back to WT_REF_LOCKED after we look at it.

Basically, this is all safe because we're holding a hazard pointer on the page, so even if eviction takes a run at the WT_REF and locks it, eviction won't be able to actually evict the page.

Copy link
Member

@sulabhM sulabhM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@keithbostic keithbostic merged commit 58e9863 into develop Feb 27, 2020
@keithbostic keithbostic deleted the wt-5689-cursor-pinned-cleanup branch February 27, 2020 04:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants