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

internal/metamorphic: fix bugs in KeyFormat abstraction #4266

Merged
merged 1 commit into from
Jan 23, 2025

Conversation

jbowens
Copy link
Collaborator

@jbowens jbowens commented Jan 16, 2025

This commit fixes a handful of bugs in the abstraction of the KeyFormat (today only the testkeys KeyFormat exists). It also introduces a --key-format= CLI flag for configuring the key format to use in a particular run of the metamorphic test.

@jbowens jbowens requested a review from a team as a code owner January 16, 2025 20:29
@jbowens jbowens requested a review from sumeerbhola January 16, 2025 20:29
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@jbowens jbowens requested a review from RaduBerinde January 16, 2025 20:35
@jbowens
Copy link
Collaborator Author

jbowens commented Jan 22, 2025

bump

Copy link
Member

@RaduBerinde RaduBerinde left a comment

Choose a reason for hiding this comment

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

:lgtm: Sorry I missed this.

Reviewable status: 0 of 18 files reviewed, 1 unresolved discussion (waiting on @jbowens and @sumeerbhola)


metamorphic/testkeys.go line 81 at r1 (raw file):

// returning a new prefix that sorts after the given prefix.
func (kg *testkeyKeyGenerator) ExtendPrefix(prefix []byte) []byte {
	return append(prefix, randBytes(kg.rng, 1, 3)...)

Should we slices.Clip(prefix) here to avoid any unexpected aliasing?

This commit fixes a handful of bugs in the abstraction of the KeyFormat (today
only the testkeys KeyFormat exists). It also introduces a --key-format= CLI
flag for configuring the key format to use in a particular run of the
metamorphic test.
Copy link
Collaborator Author

@jbowens jbowens left a comment

Choose a reason for hiding this comment

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

TFTR!

Reviewable status: 0 of 18 files reviewed, 1 unresolved discussion (waiting on @RaduBerinde and @sumeerbhola)


metamorphic/testkeys.go line 81 at r1 (raw file):

Previously, RaduBerinde wrote…

Should we slices.Clip(prefix) here to avoid any unexpected aliasing?

Good idea, done.

@jbowens jbowens merged commit 2fa3b96 into cockroachdb:master Jan 23, 2025
23 checks passed
@jbowens jbowens deleted the meta-keyformat branch January 23, 2025 15:58
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.

3 participants