Skip to content

Commit a5e67b6

Browse files
craig[bot]knzandreimateirytaftalan-mas
committed
55808: kvserver: skip non-live nodes when considering candidates for transfers r=tbg a=knz (This PR is forked off #55460 to simplify the discussion. I believe there's no discussion left here? Maybe I can merge it directly?) Fixes #55440. Prior to this patch, 3 components could attempt to transfer a replica to a node currently being drained: - the store rebalancer, which rebalances replicas based on disk usage and QPS. - the allocator, to place new replicas. - the allocator, to rebalance replicas depending on load. This commit introduces a consideration for node liveness when building the list of candidates, to detect whether a target node is acceptable. Any node that is not LIVE according to its liveness status is not considered for a transfer. Release note (bug fix): In some cases CockroachDB would attempt to transfer ranges to nodes in the process of being decommissioned or being shut down; this could cause disruption the moment the node did actually terminate. This bug has been fixed. It had been introduced some time before v2.0. 56334: kvserver: use messages on NotLeaseholderErrors everywhere r=andreimatei a=andreimatei NLHE permits custom messages in it, but the field was rarely used. This patch makes every instance where we instantiate the error provide a message, since this error comes from a wide variety of conditions. Release note: None 56345: opt: increase cost for table descriptor fetch during virtual scan r=rytaft a=rytaft This commit bumps the cost of each virtual scan to `25*randIOCostFactor` from its previous value of `10*randIOCostFactor`. This new value threads the needle so that a lookup join will still be chosen if the predicate is very selective, but the plan for the PGJDBC query identified in #55140 no longer includes lookup joins. Fixes #55140 Release note (performance improvement): Adjusted the cost model in the optimizer so that the optimizer is less likely to plan a lookup join into a virtual table. Performing a lookup join into a virtual table is expensive, so this change will generally result in better performance for queries involving joins with virtual tables. 56525: bazel: Move third party repositories to c-deps/REPOSITORIES.bzl r=otan a=alan-mas bazel: Move third party repositories to c-deps/REPOSITORIES.bzl This is one of the Bazel re-factoring that we are working on and it is about to move third party repositories out of root WORKSPACE. fixes #56053 Best practices is to separate external dependencies and it also hides the repo WORKSPACE from being used by other directories. We are creating a new .bzl file inside c-deps with all the external dependencies and then load then inside our root WORKSPACE Release note: None 56589: sql: resolve error due to drop table after schema change in same txn r=ajwerner a=jayshrivastava Previously, if a drop table statement was executed in a transaction following other schema changes to the table in the same transaction, an error would occur. This error was due to the drop table statement marking previous jobs as succeeded and then proceeding to modify them. This change ensures that drop table statement will delete all existing jobs from the job cache so that it does not interfere with previous jobs. Release note (sql change): A table can successfully be dropped in a transaction following other schema changes to the table in the same transaction. This resolves one of the issues in #56235 56597: colflow: fix recent misuse of two slices in the flow setup r=yuzefovich a=yuzefovich We've recently added the reusing of metadataSourcesQueue and toClose slices in order to reduce some allocations. However, the components that are using those slices don't make a deep copy, and as a result, we introduced a bug in which we were breaking the current contract. This commit fixes the issue by going back to the old method (with slight difference in that we currently delay any allocations unlike previously when we allocated a slice with capacity of 1). Release note: None (no release with this bug) 56598: tree: introduce concept of "default" collation r=rafiss a=otan Resolves #54989 Release note (sql change): Introduced a pg_collation of "default". Strings now return the "default" collation OID in the pg_attribute table (this was previously en_US). The "default" collation is also visible on the pg_collation virtual table. 56602: roachpb: remove various `(gogoproto.equal)` options r=nvanbenschoten a=tbg The first commit explains why some cleanup was necessary, the others are the result of spending a little extra time cleaning up "unnecessarily". There are plenty of Equals left to clean up, but the returns were diminishing. The important part is that when additions to the KV API are made, nobody will be forced to add the `equal` option any more. - roachpb: don't generate Equal() on Error - roachpb: remove more `Equal` methods - roachpb: remove (gogoproto.equal) from api.proto - roachpb: mostly remove (gogoproto.equal) from data.proto - roachpb: remove Value.Equal - kvserverpb: remove Equal from ReplicatedEvalResult Co-authored-by: Raphael 'kena' Poss <knz@thaumogen.net> Co-authored-by: Andrei Matei <andrei@cockroachlabs.com> Co-authored-by: Rebecca Taft <becca@cockroachlabs.com> Co-authored-by: Alanmas <acostas.alan@gmail.com> Co-authored-by: Jayant Shrivastava <jayants@cockroachlabs.com> Co-authored-by: Yahor Yuzefovich <yahor@cockroachlabs.com> Co-authored-by: Oliver Tan <otan@cockroachlabs.com> Co-authored-by: Tobias Grieger <tobias.b.grieger@gmail.com>
9 parents 1c17ca0 + ffa0ce3 + 3db3781 + 0830131 + 4936cfe + 7039ad8 + c554914 + 530057b + ee4580b commit a5e67b6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+2004
-6025
lines changed

WORKSPACE

Lines changed: 6 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ protobuf_deps()
6060
load("//:DEPS.bzl", "go_deps")
6161
go_deps()
6262

63+
64+
# Loading c-deps third party dependencies.
65+
load("//c-deps:REPOSITORIES.bzl", "c_deps")
66+
c_deps()
67+
68+
6369
# Load the bazel utility that lets us build C/C++ projects using cmake/make/etc.
6470
#
6571
# TODO(irfansharif): Point to an upstream SHA once it picks up Oliver's changes
@@ -71,45 +77,3 @@ git_repository(
7177
)
7278
load("@rules_foreign_cc//:workspace_definitions.bzl", "rules_foreign_cc_dependencies")
7379
rules_foreign_cc_dependencies()
74-
75-
# Define the repositories for each of our c-dependencies. BUILD_ALL_CONTENT is
76-
# a shorthand to glob over all checked-in files.
77-
BUILD_ALL_CONTENT = """filegroup(name = "all", srcs = glob(["**"]), visibility = ["//visibility:public"])"""
78-
79-
# Each of these c-dependencies map to one or more library definitions in the
80-
# top-level BUILD.bazel. Library definitions will list the following
81-
# definitions as sources. For certain libraries (like `libroachccl`), the
82-
# repository definitions are also listed as tool dependencies. This is because
83-
# building those libraries require certain checked out repositories being
84-
# placed relative to the source tree of the library itself.
85-
86-
new_local_repository(
87-
name = "libroach",
88-
path = "c-deps/libroach",
89-
build_file_content = BUILD_ALL_CONTENT,
90-
)
91-
92-
new_local_repository(
93-
name = "proj",
94-
path = "c-deps/proj",
95-
build_file_content = BUILD_ALL_CONTENT,
96-
)
97-
98-
# For c-deps/protobuf, we elide a checked in generated file. Already generated
99-
# files are read-only in the bazel sandbox, so bazel is unable to regenerate
100-
# the same files, which the build process requires it to do so.
101-
BUILD_PROTOBUF_CONTENT = """filegroup(name = "all", srcs = glob(["**"], exclude=["src/google/protobuf/compiler/js/well_known_types_embed.cc"]), visibility = ["//visibility:public"])"""
102-
new_local_repository(
103-
name = "protobuf",
104-
path = "c-deps/protobuf",
105-
build_file_content = BUILD_PROTOBUF_CONTENT,
106-
)
107-
108-
# This is essentially the same above, we elide a generated file to avoid
109-
# permission issues when building jemalloc within the bazel sandbox.
110-
BUILD_JEMALLOC_CONTENT = """filegroup(name = "all", srcs = glob(["**"], exclude=["configure"]), visibility = ["//visibility:public"])"""
111-
new_local_repository(
112-
name = "jemalloc",
113-
path = "c-deps/jemalloc",
114-
build_file_content = BUILD_JEMALLOC_CONTENT,
115-
)

c-deps/REPOSITORIES.bzl

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# c-deps repository definitions.
2+
3+
# Define the repositories for each of our c-dependencies. BUILD_ALL_CONTENT is
4+
# a shorthand to glob over all checked-in files.
5+
BUILD_ALL_CONTENT = """filegroup(name = "all", srcs = glob(["**"]), visibility = ["//visibility:public"])"""
6+
7+
# Each of these c-dependencies map to one or more library definitions in the
8+
# top-level BUILD.bazel. Library definitions will list the following
9+
# definitions as sources. For certain libraries (like `libroachccl`), the
10+
# repository definitions are also listed as tool dependencies. This is because
11+
# building those libraries require certain checked out repositories being
12+
# placed relative to the source tree of the library itself.
13+
14+
# For c-deps/protobuf, we elide a checked in generated file. Already generated
15+
# files are read-only in the bazel sandbox, so bazel is unable to regenerate
16+
# the same files, which the build process requires it to do so.
17+
BUILD_PROTOBUF_CONTENT = """filegroup(name = "all", srcs = glob(["**"], exclude=["src/google/protobuf/compiler/js/well_known_types_embed.cc"]), visibility = ["//visibility:public"])"""
18+
19+
# This is essentially the same above, we elide a generated file to avoid
20+
# permission issues when building jemalloc within the bazel sandbox.
21+
BUILD_JEMALLOC_CONTENT = """filegroup(name = "all", srcs = glob(["**"], exclude=["configure"]), visibility = ["//visibility:public"])"""
22+
23+
# We do need to add native as new_local_repository is defined in Bazel core.
24+
def c_deps():
25+
native.new_local_repository(
26+
name = "libroach",
27+
path = "c-deps/libroach",
28+
build_file_content = BUILD_ALL_CONTENT,
29+
)
30+
native.new_local_repository(
31+
name = "proj",
32+
path = "c-deps/proj",
33+
build_file_content = BUILD_ALL_CONTENT,
34+
)
35+
native.new_local_repository(
36+
name = "protobuf",
37+
path = "c-deps/protobuf",
38+
build_file_content = BUILD_PROTOBUF_CONTENT,
39+
)
40+
native.new_local_repository(
41+
name = "jemalloc",
42+
path = "c-deps/jemalloc",
43+
build_file_content = BUILD_JEMALLOC_CONTENT,
44+
)

pkg/config/system_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ package config_test
1313
import (
1414
"context"
1515
"math"
16+
"reflect"
1617
"sort"
1718
"testing"
1819

@@ -139,7 +140,7 @@ func TestGet(t *testing.T) {
139140
cfg := config.NewSystemConfig(zonepb.DefaultZoneConfigRef())
140141
for tcNum, tc := range testCases {
141142
cfg.Values = tc.values
142-
if val := cfg.GetValue([]byte(tc.key)); !val.Equal(tc.value) {
143+
if val := cfg.GetValue([]byte(tc.key)); !reflect.DeepEqual(val, tc.value) {
143144
t.Errorf("#%d: expected=%s, found=%s", tcNum, tc.value, val)
144145
}
145146
}

0 commit comments

Comments
 (0)