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

protectedts: fix panic when fetching protectedts records #79787

Merged
merged 1 commit into from
Apr 11, 2022

Conversation

adityamaru
Copy link
Contributor

Previously, we incorrectly assumed that all records in the
system.protectedts_records table would have a non NULL target
column. While this is enforced for all protected timestamp
records written in a 22.1+ cluster, this is not true for records
that might have been prior to the 22.1 cluster version being
finalized.

This change makes the method responsible for reading protectedts
records more defensive when encountering a NULL target column.

Fixes: #79684

Release note: None

@adityamaru adityamaru requested a review from a team as a code owner April 11, 2022 18:11
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@ajwerner ajwerner left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 3 of 3 files at r1, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @arulajmani)

Previously, we incorrectly assumed that all records in the
`system.protectedts_records` table would have a non NULL target
column. While this is enforced for all protected timestamp
records written in a 22.1+ cluster, this is not true for records
that might have been prior to the 22.1 cluster version being
finalized.

This change makes the method responsible for reading protectedts
records more defensive when encountering a NULL target column.

Fixes: cockroachdb#79684

Release note: None
Copy link
Collaborator

@arulajmani arulajmani left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 1 of 3 files at r1, 2 of 2 files at r2, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (and 1 stale) (waiting on @adityamaru)


pkg/kv/kvserver/protectedts/ptstorage/storage.go, line 421 at r2 (raw file):

		if !ok {
			// We are reading a pre-22.1 protected timestamp record that has a NULL
			// target column, so there is nothing more to do.

nit: add a TODO to remove this code in the next release?

@adityamaru
Copy link
Contributor Author

adityamaru commented Apr 11, 2022

nit: add a TODO to remove this code in the next release?

I promise I'll remember, don't make me push again 😋

@adityamaru
Copy link
Contributor Author

TFTRs!

bors r+

@craig
Copy link
Contributor

craig bot commented Apr 11, 2022

Build succeeded:

@craig craig bot merged commit 6de7a18 into cockroachdb:master Apr 11, 2022
@adityamaru adityamaru deleted the panic-fix branch April 12, 2022 13:33
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.

protectedts: v22.1.0-beta: interface conversion: tree.Datum is tree.dNull, not *tree.DBytes
4 participants