-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
kvserver: avoid nil deref on replica_stats merge #80071
Conversation
f5df859
to
32c6124
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @irfansharif, @kvoli, and @lidorcarmel)
-- commits, line 4 at r1:
nit: s/paritally/partially/
.
pkg/kv/kvserver/replica_stats_test.go, line 528 at r1 (raw file):
// Ensure that with uninitialzed entries in replica stats, the result // adjusts correctly. Here we expect the sliding windows to be // merged from most the recent window (tail) backwards.
nit: "most the recent" reads unusual.
A bug existed where when replica stats were merged with only partially initialized windows, merging would result in a nil ptr dereference. This patch updates the logic of replicaStatsMerge to avoid nil dereferences and appropriately handle uninitialized window records. resolves: cockroachdb#80072 Release note: None
32c6124
to
79429fc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @irfansharif, @lidorcarmel, and @yuzefovich)
Previously, yuzefovich (Yahor Yuzefovich) wrote…
nit:
s/paritally/partially/
.
Updated
pkg/kv/kvserver/replica_stats_test.go, line 528 at r1 (raw file):
Previously, yuzefovich (Yahor Yuzefovich) wrote…
nit: "most the recent" reads unusual.
Reworded.
bors r+ |
Build succeeded: |
A bug existed where when replica stats were merged with only partially
initialized windows, merging would result in a nil ptr dereference. This
patch updates the logic of replicaStatsMerge to avoid nil dereferences
and appropriately handle uninitialized window records.
resolves: #80072
Release note: None