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

catalog/lease: deflake TestLeaseAtLatestVersion #139497

Merged
merged 1 commit into from
Jan 21, 2025

Conversation

fqazi
Copy link
Collaborator

@fqazi fqazi commented Jan 21, 2025

Currently, TestLeaseAtLatestVersion can flake when the initial version
of a descriptor is acquired, which this test is not designed to handle.
To address this, this patch will intentionally use a different database
for the timestamp table, so that publishing a new version or a slow
range feed does not acquire the kv table in the same schema.

Fixes: #139386

Release note: None

@fqazi fqazi added the backport-25.1.x Flags PRs that need to be backported to 25.1 label Jan 21, 2025
@fqazi fqazi requested a review from a team as a code owner January 21, 2025 16:32
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@fqazi fqazi force-pushed the TestLeaseAtLatestVersionFlake branch from 65ed92a to 9b293a5 Compare January 21, 2025 16:32
Copy link
Collaborator

@rafiss rafiss left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @fqazi)


pkg/sql/catalog/lease/lease_test.go line 1161 at r1 (raw file):

	s := srv.ApplicationLayer()
	// This test relies on the initial version not being acquired.
	if _, err := sqlDB.Exec("SET CLUSTER SETTING sql.catalog.descriptor_wait_for_initial_version.enabled=false"); err != nil {

out of curiosity, how much work would it be to make this test work with this setting enabled?

@fqazi fqazi force-pushed the TestLeaseAtLatestVersionFlake branch 2 times, most recently from 8b9c426 to 230ce05 Compare January 21, 2025 17:41
Currently, TestLeaseAtLatestVersion can flake when the initial version
of a descriptor is acquired, which this test is not designed to handle.
To address this, this patch will intentionally use a different database
for the timestamp table, so that publishing a new version or a slow
range feed does not acquire the kv table in the same schema.

Fixes: cockroachdb#139386

Release note: None
@fqazi fqazi force-pushed the TestLeaseAtLatestVersionFlake branch from 230ce05 to 29d1a6b Compare January 21, 2025 17:42
Copy link
Collaborator Author

@fqazi fqazi left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @rafiss)


pkg/sql/catalog/lease/lease_test.go line 1161 at r1 (raw file):

Previously, rafiss (Rafi Shamim) wrote…

out of curiosity, how much work would it be to make this test work with this setting enabled?

Done.

Fair point, and a simpler workaround is to just put timestamp in its own schema. The initial version is fetched because the schema gets leased by the insert, breaking the assumptions of the test

@fqazi fqazi requested a review from rafiss January 21, 2025 17:43
Copy link
Collaborator

@rafiss rafiss left a comment

Choose a reason for hiding this comment

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

nice fix!

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained

@fqazi
Copy link
Collaborator Author

fqazi commented Jan 21, 2025

@rafiss TFTR!

bors r+

@rafiss
Copy link
Collaborator

rafiss commented Jan 21, 2025

bors r+

@craig craig bot merged commit 67f2b0d into cockroachdb:master Jan 21, 2025
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-25.1.x Flags PRs that need to be backported to 25.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sql/catalog/lease: TestLeaseAtLatestVersion failed
3 participants