Skip to content

Commit 77b21df

Browse files
craig[bot]stevendannatbg
committed
156997: kvserver: run bench without extra arguments r=pav-kv a=stevendanna Without these additions, users of `./dev bench` need to manually specify an explicit bazel target for the kvserver_test package. This always causes a few seconds (or minutes) of confusion because (1) most of us are used to not having to specify the test package and (2) its reasonable to first suspect your recent change when you hit some bazel error. Informs #147833 Epic: None Release note: none 157005: mmaprototype: explain why localities don't care about the keys r=wenyihu6 a=tbg It's because operators must use matching keys across the cluster, so only the values can be different. For example, it's not allowed to have one node with `region=foo` and another with `fruit=banana`. It must be `region=foo`,`region=banana` and that point the key no longer plays a role since it always matches. Epic: CRDB-55052 Co-authored-by: Steven Danna <[email protected]> Co-authored-by: Tobias Grieger <[email protected]>
3 parents 6708f9d + 03e2053 + 2a4de7e commit 77b21df

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

pkg/kv/kvserver/BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,9 +616,11 @@ go_proto_library(
616616
proto = ":kvserver_proto",
617617
visibility = ["//visibility:public"],
618618
deps = [
619+
"//pkg/kv/kvpb", # keep
619620
"//pkg/kv/kvserver/kvserverpb",
620621
"//pkg/roachpb",
621622
"//pkg/storage/enginepb",
623+
"//pkg/util/uuid", # keep
622624
"@com_github_gogo_protobuf//gogoproto",
623625
],
624626
)

pkg/kv/kvserver/allocator/mmaprototype/constraint.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1922,6 +1922,14 @@ func (lti *localityTierInterner) unintern(lt localityTiers) roachpb.Locality {
19221922
return locality
19231923
}
19241924

1925+
// localityTiers encodes a locality value hierarchy, represented by codes
1926+
// from an associated stringInterner.
1927+
//
1928+
// Note that CockroachDB operators must use matching *keys*[1] across all nodes
1929+
// in each deployment, so we only need to deal with a slice of locality
1930+
// *values*.
1931+
//
1932+
// [1]: https://www.cockroachlabs.com/docs/stable/cockroach-start#locality
19251933
type localityTiers struct {
19261934
tiers []stringCode
19271935
// str is useful as a map key for caching computations.

0 commit comments

Comments
 (0)