-
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
*: Address issues with tracking disk usage as capacity minus availability #17733
Conversation
pkg/storage/store.go
Outdated
var totalWritesPerSecond float64 | ||
bytesPerReplica := make([]float64, 0, capacity.RangeCount) | ||
writesPerReplica := make([]float64, 0, capacity.RangeCount) | ||
newStoreReplicaVisitor(s).Visit(func(r *Replica) bool { | ||
if r.ownsValidLease(now) { | ||
leaseCount++ | ||
} | ||
bytesPerReplica = append(bytesPerReplica, float64(r.GetMVCCStats().LiveBytes)) | ||
mvccStats := r.GetMVCCStats() | ||
// TODO(DONOTSUBMIT): Which MVCCStats fields should we use for this? |
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.
cc @petermattis for his opinion on what's most accurate here.
With one nit and obviously waiting on Peter's response. Reviewed 9 of 10 files at r1. pkg/roachpb/metadata.proto, line 115 at r1 (raw file):
Is it common practice to not have the index in order in the proto file?? Comments from Reviewable |
Oh, there's a new commit. I only looked at the first one. Review status: 4 of 21 files reviewed at latest revision, 2 unresolved discussions, some commit checks failed. Comments from Reviewable |
Still LGTM. Reviewed 16 of 17 files at r2. Comments from Reviewable |
Review status: 19 of 21 files reviewed at latest revision, 2 unresolved discussions, some commit checks pending. pkg/roachpb/metadata.proto, line 115 at r1 (raw file): Previously, BramGruneir (Bram Gruneir) wrote…
It wasn't uncommon at Google, and while I only checked a couple of our proto files we've done it before for Comments from Reviewable |
Review status: 19 of 21 files reviewed at latest revision, 2 unresolved discussions, some commit checks failed. pkg/roachpb/metadata.proto, line 115 at r1 (raw file): Previously, a-robinson (Alex Robinson) wrote…
The proto fields should be grouped in the natural order, ignoring tag numbers. Forcing the fields into tag number order reduces readability. For the most part, the tag numbers aren't something you care about. pkg/storage/store.go, line 2280 at r2 (raw file): Previously, a-robinson (Alex Robinson) wrote…
Depends on the purpose? My guess is that Comments from Reviewable |
and nice, this was an ugly wart! Reviewed 10 of 10 files at r1, 16 of 17 files at r2, 1 of 1 files at r3. pkg/roachpb/metadata.go, line 275 at r3 (raw file):
Where are we still using pkg/roachpb/metadata.proto, line 115 at r1 (raw file): Previously, petermattis (Peter Mattis) wrote…
I'm not aware of a fixed precedent, and while I like to keep them in order, I definitely see how it makes sense the way it is in this diff. pkg/storage/allocator_scorer.go, line 523 at r1 (raw file):
What's that lonely pkg/storage/allocator_scorer.go, line 567 at r1 (raw file):
What does capacity print like with pkg/storage/store.go, line 2280 at r2 (raw file): Previously, a-robinson (Alex Robinson) wrote…
I think Comments from Reviewable |
Review status: all files reviewed at latest revision, 5 unresolved discussions, some commit checks failed. pkg/storage/store.go, line 2280 at r2 (raw file): Previously, tschottdorf (Tobias Schottdorf) wrote…
I would definitely include Comments from Reviewable |
TFTRs! Review status: 2 of 22 files reviewed at latest revision, 5 unresolved discussions. pkg/roachpb/metadata.go, line 275 at r3 (raw file): Previously, tschottdorf (Tobias Schottdorf) wrote…
The max-capacity check that attempts to avoid filling a node past 95% - https://github.com/cockroachdb/cockroach/blob/master/pkg/storage/allocator_scorer.go#L966 pkg/storage/allocator_scorer.go, line 523 at r1 (raw file): Previously, tschottdorf (Tobias Schottdorf) wrote…
It's not meant to be there, must have either been a mistake or a leftover from some prior version of the format string.
pkg/storage/allocator_scorer.go, line 567 at r1 (raw file): Previously, tschottdorf (Tobias Schottdorf) wrote…
It prints as defined by pkg/storage/store.go, line 2280 at r2 (raw file): Previously, petermattis (Peter Mattis) wrote…
Hm, I was going to include It seems to me like either Comments from Reviewable |
Reviewed 20 of 20 files at r4, 17 of 17 files at r5. pkg/storage/allocator_scorer.go, line 523 at r1 (raw file): Previously, a-robinson (Alex Robinson) wrote…
And the pkg/storage/allocator_scorer.go, line 567 at r1 (raw file): Previously, a-robinson (Alex Robinson) wrote…
Sorry, I'm fine with pkg/storage/store.go, line 2280 at r2 (raw file): Previously, a-robinson (Alex Robinson) wrote…
Hmm, I'm not totally sure, but I'm afraid we're doing something weird in Either way, ISTM that Comments from Reviewable |
Review status: all files reviewed at latest revision, 4 unresolved discussions, some commit checks failed. pkg/storage/allocator_scorer.go, line 567 at r1 (raw file): Previously, tschottdorf (Tobias Schottdorf) wrote…
No, it boils down to pkg/storage/store.go, line 2280 at r2 (raw file): Previously, tschottdorf (Tobias Schottdorf) wrote…
Thanks! Comments from Reviewable |
So I think this is good to go, but now we don't have a graph in the admin UI that directly corresponds to what we're using to rebalance. We export metrics for |
Feels like the "Live Bytes per Store" graph should be renamed to "Logical Bytes per Store". Seems useful to graph the metric the rebalancer is using. |
Right, but it's not a matter of renaming, it's a matter of having the right data to graph. |
Ok. Let's get this change merged and file a follow-on issue to change the graph. |
Fixes cockroachdb#17912. This was broken by cockroachdb#17733.
See commit descriptions for details. The first commit is important to improving stats-based rebalancing. The second commit isn't necessary, but I got halfway done with it while thinking through the first one so included it anyways. I'm happy to separate it out for later if desired.
Addresses #17691 and #13548. I'll regenerate embedded.go before submitting.