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

kvserverbase: move MaxCommandSizeDefault out of kvserver #77803

Merged
merged 1 commit into from
Mar 18, 2022
Merged
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
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 @@ -29,8 +29,8 @@ go_library(
"//pkg/jobs/jobspb",
"//pkg/keys",
"//pkg/kv",
"//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