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

schemachanger: port over MR zone config helpers #141386

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pkg/sql/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,7 @@ go_test(
"//pkg/sql/privilege",
"//pkg/sql/querycache",
"//pkg/sql/randgen",
"//pkg/sql/regions",
"//pkg/sql/row",
"//pkg/sql/rowenc",
"//pkg/sql/rowenc/keyside",
Expand Down
398 changes: 24 additions & 374 deletions pkg/sql/region_util.go

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion pkg/sql/region_util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/cockroachdb/cockroach/pkg/sql/catalog/catpb"
"github.com/cockroachdb/cockroach/pkg/sql/catalog/descpb"
"github.com/cockroachdb/cockroach/pkg/sql/catalog/multiregion"
"github.com/cockroachdb/cockroach/pkg/sql/regions"
"github.com/cockroachdb/cockroach/pkg/testutils"
"github.com/cockroachdb/cockroach/pkg/util/leaktest"
"github.com/gogo/protobuf/proto"
Expand Down Expand Up @@ -1899,7 +1900,7 @@ func TestZoneConfigForMultiRegionPartition(t *testing.T) {
}
for _, tc := range testCases {
t.Run(tc.desc, func(t *testing.T) {
zc, err := zoneConfigForMultiRegionPartition(tc.region, tc.regionConfig)
zc, err := regions.ZoneConfigForMultiRegionPartition(tc.region, tc.regionConfig)
require.NoError(t, err)
require.Equal(t, tc.expected, zc)
})
Expand Down
3 changes: 3 additions & 0 deletions pkg/sql/regions/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,18 @@ go_library(
"cached_db_regions.go",
"db_regions.go",
"region_provider.go",
"region_util.go",
],
importpath = "github.com/cockroachdb/cockroach/pkg/sql/regions",
visibility = ["//visibility:public"],
deps = [
"//pkg/config/zonepb",
"//pkg/keys",
"//pkg/kv",
"//pkg/roachpb",
"//pkg/server/serverpb",
"//pkg/sql/catalog",
"//pkg/sql/catalog/catpb",
"//pkg/sql/catalog/descpb",
"//pkg/sql/catalog/descs",
"//pkg/sql/catalog/lease",
Expand Down
Loading
Loading