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

storage: add empty DeprecatedTxnSpanGCThreshold to snapshot when key missing #39145

Merged
merged 1 commit into from
Jul 29, 2019

Conversation

nvanbenschoten
Copy link
Member

Fixes #39138.

This was missed in #39003. v19.1 nodes populate their ReplicaState with an empty TxnSpanGCThreshold when the key is missing, not a nil TxnSpanGCThreshold. See

// LoadTxnSpanGCThreshold loads the transaction GC threshold.
func (rsl StateLoader) LoadTxnSpanGCThreshold(
ctx context.Context, reader engine.Reader,
) (*hlc.Timestamp, error) {
var t hlc.Timestamp
_, err := engine.MVCCGetProto(ctx, reader, rsl.RangeTxnSpanGCThresholdKey(),
hlc.Timestamp{}, &t, engine.MVCCGetOptions{})
return &t, err
}

We need to do the same to avoid an assertion failure after a snapshot.

Release note: None

…missing

Fixes cockroachdb#39138.

This was missed in cockroachdb#39003. v19.1 nodes populate their ReplicaState with an
empty TxnSpanGCThreshold when the key is missing, not a nil TxnSpanGCThreshold.
See https://github.com/cockroachdb/cockroach/blob/b8554ec29fd1620c0e6af9544d678db57d251f4c/pkg/storage/stateloader/stateloader.go#L474.
We need to do the same to avoid an assertion failure after a snapshot.

Release note: None
@nvanbenschoten nvanbenschoten requested review from ajwerner and a team July 29, 2019 04:04
@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.

Nice find.

Reviewed 1 of 1 files at r1.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained

@nvanbenschoten
Copy link
Member Author

bors r+

craig bot pushed a commit that referenced this pull request Jul 29, 2019
39145: storage: add empty DeprecatedTxnSpanGCThreshold to snapshot when key missing r=nvanbenschoten a=nvanbenschoten

Fixes #39138.

This was missed in #39003. v19.1 nodes populate their ReplicaState with an empty TxnSpanGCThreshold when the key is missing, not a nil TxnSpanGCThreshold. See https://github.com/cockroachdb/cockroach/blob/b8554ec29fd1620c0e6af9544d678db57d251f4c/pkg/storage/stateloader/stateloader.go#L474-L482

We need to do the same to avoid an assertion failure after a snapshot.

Release note: None

Co-authored-by: Nathan VanBenschoten <[email protected]>
@craig
Copy link
Contributor

craig bot commented Jul 29, 2019

Build succeeded

@craig craig bot merged commit cf72c7f into cockroachdb:master Jul 29, 2019
@nvanbenschoten nvanbenschoten deleted the nvanbenschoten/fix39138 branch July 29, 2019 17:21
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.

roachtest: version/mixed/nodes=5 failed
4 participants