protectedts: fix panic when fetching protectedts records#79787
Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom Apr 11, 2022
Merged
protectedts: fix panic when fetching protectedts records#79787craig[bot] merged 1 commit intocockroachdb:masterfrom
craig[bot] merged 1 commit intocockroachdb:masterfrom
Conversation
Member
ajwerner
approved these changes
Apr 11, 2022
Contributor
ajwerner
left a comment
There was a problem hiding this comment.
Reviewed 3 of 3 files at r1, all commit messages.
Reviewable status: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
arulajmani
approved these changes
Apr 11, 2022
Collaborator
arulajmani
left a comment
There was a problem hiding this comment.
Reviewed 1 of 3 files at r1, 2 of 2 files at r2, all commit messages.
Reviewable status: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?
Contributor
Author
I promise I'll remember, don't make me push again 😋 |
Contributor
Author
|
TFTRs! bors r+ |
Contributor
|
Build succeeded: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, we incorrectly assumed that all records in the
system.protectedts_recordstable would have a non NULL targetcolumn. 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