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

cdctest: fix fingerprint validator primary key cols check #139958

Merged
merged 1 commit into from
Jan 29, 2025

Conversation

wenyihu6
Copy link
Contributor

Previously, fingerprint validator could fail with sql smith due to precision
loss from JSON encoding & decoding of large numbers. We previously fixed the
validator regarding its values check. This patch fixes the primary key columns
check accordingly.

Part of: #124146
Release note: none

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@wenyihu6 wenyihu6 requested review from asg0451 and aerfrei January 28, 2025 17:18
@wenyihu6 wenyihu6 marked this pull request as ready for review January 28, 2025 17:18
@wenyihu6 wenyihu6 requested a review from a team as a code owner January 28, 2025 17:18
@wenyihu6
Copy link
Contributor Author

The first commit comes from #139914.

After map[string]interface{} `json:"after"`
}
var value wrapper
if err := gojson.Unmarshal([]byte(row.value), &value); err != nil {
Copy link
Contributor

@aerfrei aerfrei Jan 28, 2025

Choose a reason for hiding this comment

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

Trying to understand what's going on here.
Is this what's happening? Previously we had an issue with the declarative schema changer where JSON encoded data was failing these assertions. Then we introduced using gojson to fix that problem. This did not work so now we a) avoid using that schema changer in tests until we fix that more permanently and b) remove the previous fix that didn't work.

Ok, so using this style of JSON decoding fixes the issue instead of using gojson. We don't know why we were using gojson previously but it doesn't seem like it was for any particular reason. Sounds good

Copy link
Contributor

Choose a reason for hiding this comment

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

i believe this section is to fix an error where gojson truncated large int64s in the key during decoding

Previously, fingerprint validator could fail with sql smith due to precision
loss from JSON encoding & decoding of large numbers. We previously fixed the
validator regarding its values check. This patch fixes the primary key columns
check accordingly.

Part of: cockroachdb#124146
Release note: none
Copy link

blathers-crl bot commented Jan 29, 2025

It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR?

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@wenyihu6
Copy link
Contributor Author

TFTR!

bors r=asg0451

@craig craig bot merged commit 05eaf5a into cockroachdb:master Jan 29, 2025
22 checks passed
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.

4 participants