Skip to content

Commit

Permalink
kvserverbase: move MaxCommandSizeDefault out of kvserver
Browse files Browse the repository at this point in the history
```
$ bazel query "somepath(//pkg/sql, //pkg/kv/kvserver)"
INFO: Empty results
Loading: 0 packages loaded
```

Release justification: non-production code changes

Release note: None
  • Loading branch information
ajwerner committed Mar 15, 2022
1 parent 87a3366 commit eea3500
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
4 changes: 4 additions & 0 deletions pkg/kv/kvserver/kvserverbase/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,3 +223,7 @@ var SplitByLoadMergeDelay = settings.RegisterDurationSetting(
return nil
},
)

// MaxCommandSizeDefault is the default for the kv.raft.command.max_size
// cluster setting.
const MaxCommandSizeDefault = 64 << 20
5 changes: 1 addition & 4 deletions pkg/kv/kvserver/replica.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,14 @@ const (
// MaxCommandSizeFloor is the minimum allowed value for the
// kv.raft.command.max_size cluster setting.
MaxCommandSizeFloor = 4 << 20 // 4MB
// MaxCommandSizeDefault is the default for the kv.raft.command.max_size
// cluster setting.
MaxCommandSizeDefault = 64 << 20
)

// MaxCommandSize wraps "kv.raft.command.max_size".
var MaxCommandSize = settings.RegisterByteSizeSetting(
settings.TenantWritable,
"kv.raft.command.max_size",
"maximum size of a raft command",
MaxCommandSizeDefault,
kvserverbase.MaxCommandSizeDefault,
func(size int64) error {
if size < MaxCommandSizeFloor {
return fmt.Errorf("max_size must be greater than %s", humanizeutil.IBytes(MaxCommandSizeFloor))
Expand Down
2 changes: 1 addition & 1 deletion pkg/sql/row/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ go_library(
"//pkg/keys",
"//pkg/kv",
"//pkg/kv/kvclient/kvstreamer",
"//pkg/kv/kvserver",
"//pkg/kv/kvserver/concurrency/lock",
"//pkg/kv/kvserver/kvserverbase",
"//pkg/roachpb",
"//pkg/settings",
"//pkg/settings/cluster",
Expand Down
4 changes: 2 additions & 2 deletions pkg/sql/row/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (

"github.com/cockroachdb/cockroach/pkg/keys"
"github.com/cockroachdb/cockroach/pkg/kv"
"github.com/cockroachdb/cockroach/pkg/kv/kvserver"
"github.com/cockroachdb/cockroach/pkg/kv/kvserver/kvserverbase"
"github.com/cockroachdb/cockroach/pkg/roachpb"
"github.com/cockroachdb/cockroach/pkg/settings"
"github.com/cockroachdb/cockroach/pkg/sql/catalog"
Expand Down Expand Up @@ -48,7 +48,7 @@ var maxRowSizeLog = settings.RegisterByteSizeSetting(
"maximum size of row (or column family if multiple column families are in use) that SQL can "+
"write to the database, above which an event is logged to SQL_PERF (or SQL_INTERNAL_PERF "+
"if the mutating statement was internal); use 0 to disable",
kvserver.MaxCommandSizeDefault,
kvserverbase.MaxCommandSizeDefault,
func(size int64) error {
if size != 0 && size < maxRowSizeFloor {
return errors.Newf(
Expand Down

0 comments on commit eea3500

Please sign in to comment.