Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
74918: sql,ccl: remove catalogkv package r=postamar a=postamar

    sql,ccl: remove catalogkv package
    
    Previously, the catalogkv package allowed unmediated access to catalog
    descriptors and namespace entries. Instead, we want like all such
    accessess to be mediated by descs.Collection.
    
    This commit is a step in this direction. The catalogkv package has been
    broken up in multiple packages in sql/catalog:
    - descidgen, for descriptor ID generation;
    - descbuilder, for catalog.Descriptor builders;
    - internal/catkv, for everything else.
    
    This commit also gets rid of the DescGetter and BatchDescGetter
    interfaces and makes descriptor validation internal to the catalog
    packages. In so doing, this commit also modifies the DescriptorBuilder
    interface to reflect the fact that there are two upgrade paths:
    - the existing RunPostDeserializationChanges path which gets exercised
      in mixed-version clusters;
    - a new RunPostRestoreChanges which gets exercised following a RESTORE,
      or any time a possibly-old descriptor comes into existence bypassing
      cluster upgrades and migrations which upgrade descriptor
      representations.
    
    This commit also introduces nstree.Catalog, which is roughly what the
    catalog.MapDescGetter used to be, but with the added benefit of
    preserving ordering.
    
    In doing all these things, it's been possible to streamline descriptor
    and namespace lookups in some specific cases, which reduces the number
    of roundtrips to the KV layer. Generally speaking, this commit doesn't
    fundamentally change much in terms of behavior.
    
    Release note: None

75450: go.mod: update to cockroach-go 2.2.6 r=rafiss a=rafiss

This contains a fix for the error message when retrying a transaction
fails.

refs #74892

Release note: None

75489: cli: update debug recover command procedure help r=erikgrinaker a=aliher1911

Updated recovery procedure with steps that user need to perform
when executing unsafe loss of quorum recovery.

Release note: None

Co-authored-by: Marius Posta <[email protected]>
Co-authored-by: Rafi Shamim <[email protected]>
Co-authored-by: Oleg Afanasyev <[email protected]>
  • Loading branch information
4 people committed Jan 25, 2022
4 parents 2367979 + fa193c3 + 5afd6f6 + 92d9171 commit 507dd71
Show file tree
Hide file tree
Showing 245 changed files with 3,085 additions and 3,178 deletions.
6 changes: 3 additions & 3 deletions DEPS.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -1144,10 +1144,10 @@ def go_deps():
name = "com_github_cockroachdb_cockroach_go_v2",
build_file_proto_mode = "disable_global",
importpath = "github.com/cockroachdb/cockroach-go/v2",
sha256 = "834fe4a8ae5cf368639c269126288a0664399b2b14e84c2f39c3ddb861aa460d",
strip_prefix = "github.com/cockroachdb/cockroach-go/v2@v2.1.1",
sha256 = "c69c60f98ba1e3449bb60985b44fcfb0e8ae0fd4e3974abb1c997a0b9d5faca0",
strip_prefix = "github.com/cockroachdb/cockroach-go/v2@v2.2.6",
urls = [
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/cockroach-go/v2/com_github_cockroachdb_cockroach_go_v2-v2.1.1.zip",
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/cockroach-go/v2/com_github_cockroachdb_cockroach_go_v2-v2.2.6.zip",
],
)
go_repository(
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ require (
github.com/cockroachdb/apd/v3 v3.0.0
github.com/cockroachdb/circuitbreaker v2.2.2-0.20190114160014-a614b14ccf63+incompatible
github.com/cockroachdb/cmux v0.0.0-20170110192607-30d10be49292
github.com/cockroachdb/cockroach-go/v2 v2.1.1
github.com/cockroachdb/cockroach-go/v2 v2.2.6
github.com/cockroachdb/crlfmt v0.0.0-20210128092314-b3eff0b87c79
github.com/cockroachdb/datadriven v1.0.1-0.20211007161720-b558070c3be0
github.com/cockroachdb/errors v1.8.6
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,8 @@ github.com/cockroachdb/circuitbreaker v2.2.2-0.20190114160014-a614b14ccf63+incom
github.com/cockroachdb/circuitbreaker v2.2.2-0.20190114160014-a614b14ccf63+incompatible/go.mod h1:v3T8+rm/HmCL0D1BwDcGaHHAQDuFPW7EsnYs2nBRqUo=
github.com/cockroachdb/cmux v0.0.0-20170110192607-30d10be49292 h1:dzj1/xcivGjNPwwifh/dWTczkwcuqsXXFHY1X/TZMtw=
github.com/cockroachdb/cmux v0.0.0-20170110192607-30d10be49292/go.mod h1:qRiX68mZX1lGBkTWyp3CLcenw9I94W2dLeRvMzcn9N4=
github.com/cockroachdb/cockroach-go/v2 v2.1.1 h1:3XzfSMuUT0wBe1a3o5C0eOTcArhmmFAg2Jzh/7hhKqo=
github.com/cockroachdb/cockroach-go/v2 v2.1.1/go.mod h1:7NtUnP6eK+l6k483WSYNrq3Kb23bWV10IRV1TyeSpwM=
github.com/cockroachdb/cockroach-go/v2 v2.2.6 h1:LTh++UIVvmDBihDo1oYbM8+OruXheusw+ILCONlAm/w=
github.com/cockroachdb/cockroach-go/v2 v2.2.6/go.mod h1:q4ZRgO6CQpwNyEvEwSxwNrOSVchsmzrBnAv3HuZ3Abc=
github.com/cockroachdb/crlfmt v0.0.0-20210128092314-b3eff0b87c79 h1:4s0GWs4NXFK4JEeUc0Q1pRbL4oMbqh1DK70qeQ+viOA=
github.com/cockroachdb/crlfmt v0.0.0-20210128092314-b3eff0b87c79/go.mod h1:EOI6rrXIdP+4EXwM8837kmmb6IJesf7k7W6bUu8BDOg=
github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8=
Expand Down
30 changes: 15 additions & 15 deletions pkg/bench/rttanalysis/testdata/benchmark_expectations
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ exp,benchmark
24,AlterTableConfigureZone/alter_table_configure_zone_5_replicas
24,AlterTableConfigureZone/alter_table_configure_zone_7_replicas_
24,AlterTableConfigureZone/alter_table_configure_zone_ranges
21,AlterTableDropColumn/alter_table_drop_1_column
23,AlterTableDropColumn/alter_table_drop_2_columns
25,AlterTableDropColumn/alter_table_drop_3_columns
19,AlterTableDropConstraint/alter_table_drop_1_check_constraint
20-21,AlterTableDropConstraint/alter_table_drop_2_check_constraints
21,AlterTableDropConstraint/alter_table_drop_3_check_constraints
20,AlterTableDropColumn/alter_table_drop_1_column
21,AlterTableDropColumn/alter_table_drop_2_columns
22,AlterTableDropColumn/alter_table_drop_3_columns
18,AlterTableDropConstraint/alter_table_drop_1_check_constraint
18,AlterTableDropConstraint/alter_table_drop_2_check_constraints
18,AlterTableDropConstraint/alter_table_drop_3_check_constraints
15-16,AlterTableSplit/alter_table_split_at_1_value
21-22,AlterTableSplit/alter_table_split_at_2_values
27-28,AlterTableSplit/alter_table_split_at_3_values
Expand All @@ -31,13 +31,13 @@ exp,benchmark
19,CreateRole/create_role_with_2_options
20,CreateRole/create_role_with_3_options
18-19,CreateRole/create_role_with_no_options
26,DropDatabase/drop_database_0_tables
24,DropDatabase/drop_database_0_tables
30-35,DropDatabase/drop_database_1_table
36-42,DropDatabase/drop_database_2_tables
42-47,DropDatabase/drop_database_3_tables
27,DropRole/drop_1_role
34,DropRole/drop_2_roles
41,DropRole/drop_3_roles
25,DropRole/drop_1_role
32,DropRole/drop_2_roles
39,DropRole/drop_3_roles
22,DropSequence/drop_1_sequence
28,DropSequence/drop_2_sequences
34,DropSequence/drop_3_sequences
Expand All @@ -63,11 +63,11 @@ exp,benchmark
15,ORMQueries/information_schema._pg_index_position
2,ORMQueries/pg_attribute
2,ORMQueries/pg_class
13,ORMQueries/pg_is_other_temp_schema
33,ORMQueries/pg_is_other_temp_schema_multiple_times
6,ORMQueries/pg_my_temp_schema
6,ORMQueries/pg_my_temp_schema_multiple_times
6,ORMQueries/pg_namespace
9,ORMQueries/pg_is_other_temp_schema
21,ORMQueries/pg_is_other_temp_schema_multiple_times
4,ORMQueries/pg_my_temp_schema
4,ORMQueries/pg_my_temp_schema_multiple_times
4,ORMQueries/pg_namespace
2,ORMQueries/pg_type
19,Revoke/revoke_all_on_1_table
21,Revoke/revoke_all_on_2_tables
Expand Down
6 changes: 4 additions & 2 deletions pkg/ccl/backupccl/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,13 @@ go_library(
"//pkg/sql",
"//pkg/sql/catalog",
"//pkg/sql/catalog/catalogkeys",
"//pkg/sql/catalog/catalogkv",
"//pkg/sql/catalog/catconstants",
"//pkg/sql/catalog/catpb",
"//pkg/sql/catalog/catprivilege",
"//pkg/sql/catalog/colinfo",
"//pkg/sql/catalog/dbdesc",
"//pkg/sql/catalog/descbuilder",
"//pkg/sql/catalog/descidgen",
"//pkg/sql/catalog/descpb",
"//pkg/sql/catalog/descs",
"//pkg/sql/catalog/multiregion",
Expand Down Expand Up @@ -203,9 +204,10 @@ go_test(
"//pkg/sql",
"//pkg/sql/catalog",
"//pkg/sql/catalog/catalogkeys",
"//pkg/sql/catalog/catalogkv",
"//pkg/sql/catalog/descidgen",
"//pkg/sql/catalog/descpb",
"//pkg/sql/catalog/descs",
"//pkg/sql/catalog/desctestutils",
"//pkg/sql/catalog/lease",
"//pkg/sql/catalog/systemschema",
"//pkg/sql/catalog/tabledesc",
Expand Down
4 changes: 2 additions & 2 deletions pkg/ccl/backupccl/backup_planning.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ import (
"github.com/cockroachdb/cockroach/pkg/settings/cluster"
"github.com/cockroachdb/cockroach/pkg/sql"
"github.com/cockroachdb/cockroach/pkg/sql/catalog"
"github.com/cockroachdb/cockroach/pkg/sql/catalog/catalogkv"
"github.com/cockroachdb/cockroach/pkg/sql/catalog/colinfo"
"github.com/cockroachdb/cockroach/pkg/sql/catalog/descbuilder"
"github.com/cockroachdb/cockroach/pkg/sql/catalog/descpb"
"github.com/cockroachdb/cockroach/pkg/sql/catalog/tabledesc"
"github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgcode"
Expand Down Expand Up @@ -1445,7 +1445,7 @@ func getBackupDetailAndManifest(
descriptorProtos = initialDetails.ResolvedTargets
targetDescs = make([]catalog.Descriptor, len(descriptorProtos))
for i := range descriptorProtos {
targetDescs[i] = catalogkv.NewBuilder(&descriptorProtos[i]).BuildExistingMutable()
targetDescs[i] = descbuilder.NewBuilder(&descriptorProtos[i]).BuildExistingMutable()
}
}

Expand Down
Loading

0 comments on commit 507dd71

Please sign in to comment.