Skip to content

Commit

Permalink
spanconfig/store: improve commentary, tests and naming
Browse files Browse the repository at this point in the history
Release note: None
  • Loading branch information
irfansharif committed Apr 29, 2022
1 parent 3b0df85 commit 4124128
Show file tree
Hide file tree
Showing 15 changed files with 500 additions and 326 deletions.
1 change: 1 addition & 0 deletions build/bazelutil/check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ pkg/security/securitytest/securitytest.go://go:generate go-bindata -mode 0600 -m
pkg/security/securitytest/securitytest.go://go:generate gofmt -s -w embedded.go
pkg/security/securitytest/securitytest.go://go:generate goimports -w embedded.go
pkg/server/api_v2.go://go:generate swagger generate spec -w . -o ../../docs/generated/swagger/spec.json --scan-models
pkg/spanconfig/spanconfigstore/span_store.go://go:generate ../../util/interval/generic/gen.sh *entry spanconfigstore
pkg/sql/conn_fsm.go://go:generate ../util/fsm/gen/reports.sh TxnStateTransitions stateNoTxn
pkg/sql/opt/optgen/lang/gen.go://go:generate langgen -out expr.og.go exprs lang.opt
pkg/sql/opt/optgen/lang/gen.go://go:generate langgen -out operator.og.go ops lang.opt
Expand Down
4 changes: 2 additions & 2 deletions pkg/gen/misc.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ MISC_SRCS = [
"//pkg/kv/kvserver/spanlatch:latch_interval_btree_test.go",
"//pkg/roachpb:batch_generated.go",
"//pkg/roachprod/vm/aws:terraform/main.tf",
"//pkg/spanconfig/spanconfigstore:spanconfigstoreentry_interval_btree.go",
"//pkg/spanconfig/spanconfigstore:spanconfigstoreentry_interval_btree_test.go",
"//pkg/spanconfig/spanconfigstore:entry_interval_btree.go",
"//pkg/spanconfig/spanconfigstore:entry_interval_btree_test.go",
"//pkg/sql/lexbase:keywords.go",
"//pkg/sql/lexbase:reserved_keywords.go",
"//pkg/sql/lexbase:tokens.go",
Expand Down
2 changes: 1 addition & 1 deletion pkg/spanconfig/spanconfigreconciler/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ func (f *fullReconciler) reconcile(
// KV, in order to delete them. After doing so, we'll issue those same
// deletions against this copy in order for it to reflect an up-to-date view
// of span configs.
storeWithLatestSpanConfigs = storeWithExistingSpanConfigs.Copy(ctx)
storeWithLatestSpanConfigs = storeWithExistingSpanConfigs.Clone()

// Delete all updated spans in a store populated with all current records.
// Because our translation above captures the entire SQL state, deleting all
Expand Down
7 changes: 3 additions & 4 deletions pkg/spanconfig/spanconfigstore/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ go_library(
"span_store.go",
"store.go",
"system_store.go",
":spanconfigstoreentry_interval_btree.go", # keep
":entry_interval_btree.go", # keep
],
importpath = "github.com/cockroachdb/cockroach/pkg/spanconfig/spanconfigstore",
visibility = ["//visibility:public"],
Expand All @@ -33,7 +33,7 @@ go_test(
"span_store_test.go",
"store_test.go",
"system_store_test.go",
":spanconfigstoreentry_interval_btree_test.go", # keep
":entry_interval_btree_test.go", # keep
],
data = glob(["testdata/**"]),
embed = [":spanconfigstore"],
Expand All @@ -46,7 +46,6 @@ go_test(
"//pkg/testutils",
"//pkg/util/hlc",
"//pkg/util/leaktest",
"//pkg/util/log",
"//pkg/util/randutil",
"@com_github_cockroachdb_datadriven//:datadriven",
"@com_github_stretchr_testify//require",
Expand All @@ -56,5 +55,5 @@ go_test(
gen_interval_btree(
name = "spanconfig_interval_btree",
package = "spanconfigstore",
type = "*spanConfigStoreEntry",
type = "*entry",
)

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4124128

Please sign in to comment.