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

server: fix TestLogGC test #138174

Merged
merged 1 commit into from
Jan 2, 2025
Merged

Conversation

kyle-a-wong
Copy link
Contributor

This test started failing after #137069 was merged into mater. That PR introduced a change that made it so that a lock is acquired when performing the initial scan for a DELETE, over all scanned rows. As a result, a race condition was exposed in TestLogGC (specifically when the deadlock flag is set) where calling gcSystemLog resulted in a TransactionRetryError: retry txn error.

This race condition is happening because thetest data being written is using timestamps in the future as opposed to the past. When attemping to GC the table, its conflict with normal writes that are happening at the same time. To fix, the test data is being written in the past, which avoids these conflicts.

Fixes: #137490
Release note: None

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
This test started failing after cockroachdb#137069 was
merged into mater. That PR introduced a change
that made it so that a lock is acquired when
performing the initial scan for a DELETE,
over all scanned rows. As a result, a race
condition was exposed in TestLogGC (specifically
when the deadlock flag is set) where calling
`gcSystemLog` resulted in a
`TransactionRetryError: retry txn` error.

This race condition is happening because the
test data being written is using timestamps
in the future as opposed to the past. When
attemping to GC the table, its conflict with
normal writes that are happening at the
same time. To fix, the test data is being
written in the past, which avoids these
conflicts.

Fixes: cockroachdb#137490
Release note: None
@kyle-a-wong kyle-a-wong requested a review from a team as a code owner January 2, 2025 20:16
@kyle-a-wong kyle-a-wong requested review from dhartunian and removed request for a team January 2, 2025 20:16
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator

@michae2 michae2 left a comment

Choose a reason for hiding this comment

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

:lgtm: Nice fix!

Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @angles-n-daemons, @dhartunian, @kyle-a-wong, and @xinhaoz)


-- commits line 5 at r1:
typo: "master"

@kyle-a-wong
Copy link
Contributor Author

Tftr!

bors r+

@craig craig bot merged commit fa660cb into cockroachdb:master Jan 2, 2025
22 checks passed
@kyle-a-wong kyle-a-wong deleted the fix_testloggc branch January 6, 2025 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

server: TestLogGC failed
3 participants