-
Notifications
You must be signed in to change notification settings - Fork 646
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
Improve test coverage for releaseRange rollbacks. #37
Conversation
Codecov Report
@@ Coverage Diff @@
## master #37 +/- ##
=========================================
Coverage ? 85.14%
=========================================
Files ? 9
Lines ? 1851
Branches ? 0
=========================================
Hits ? 1576
Misses ? 163
Partials ? 112 Continue to review full report at Codecov.
|
tx_test.go
Outdated
@@ -602,6 +602,108 @@ func TestTx_CopyFile_Error_Normal(t *testing.T) { | |||
} | |||
} | |||
|
|||
// Ensure that a update that releases pages in ranges between read transactions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To follow go-style function comment, do TestTx_releaseRange ensures that...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also I think the test comment should say what we mean by "properly". In particular, this is a correctness test that verifies we don't "overfree". (Unless I read the code wrong.)
} | ||
} | ||
|
||
put("k1", "v1") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the test sequence is deterministic. we could randomize the test sequence to increase our confidence. but i think it is OK for now. better than nothing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, definitely better than nothing. Could leave behind a TODO comment about that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good questions. Yes, the goal of this test is fairly modest-- Guarantee that we have coverage of a releaseRange
being applied to the txid ranges between long running transactions and that we check that the read transactions can read values from the txids they are pinned to after the release.
I'll flesh out the documentation of this test to make this more clear.
I'm working on a separate quick
(randomized) test that might be better used for soak testing. I need to compare it with the existing simulation_test
and then will send out an issue summarizing how it would work for review, and if there is interest in a PR, I'll submit one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jpbetz thanks! make sense to me.
lgtm. defer to @heyitsanthony |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm thanks
This is aimed at increasing coverage of
freelist.releaseRange
from thetx
level, with a focus on exercising the rollback logic for cases where long running read transactions are holding pages in the pending state.