-
Notifications
You must be signed in to change notification settings - Fork 759
[release-8.5-keyspace] add option to skip rawkv region bound #10535
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
0ef292c
4473520
4a19d98
d2798e3
bff1863
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -245,6 +245,7 @@ const ( | |
| defaultGCTunerThreshold = 0.6 | ||
| minGCTunerThreshold = 0 | ||
| maxGCTunerThreshold = 0.9 | ||
| defaultDisableRawKVRegionSplit = false | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we change to enablexxx?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It may introduce configuration compatibility issues.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But usually we use enablexxx for a switch. |
||
|
|
||
| defaultWaitRegionSplitTimeout = 30 * time.Second | ||
| defaultCheckRegionSplitInterval = 50 * time.Millisecond | ||
|
|
@@ -877,6 +878,8 @@ type KeyspaceConfig struct { | |
| WaitRegionSplit bool `toml:"wait-region-split" json:"wait-region-split"` | ||
| // WaitRegionSplitTimeout indicates the max duration to wait region split. | ||
| WaitRegionSplitTimeout typeutil.Duration `toml:"wait-region-split-timeout" json:"wait-region-split-timeout"` | ||
| // DisableRawKVRegionSplit indicates whether to skip raw kv region split. | ||
| DisableRawKVRegionSplit bool `toml:"disable-raw-kv-region-split" json:"disable-raw-kv-region-split,string"` | ||
| // CheckRegionSplitInterval indicates the interval to check whether the region split is complete | ||
| CheckRegionSplitInterval typeutil.Duration `toml:"check-region-split-interval" json:"check-region-split-interval"` | ||
| } | ||
|
|
@@ -903,6 +906,9 @@ func (c *KeyspaceConfig) adjust(meta *configutil.ConfigMetaData) { | |
| if !meta.IsDefined("check-region-split-interval") { | ||
| c.CheckRegionSplitInterval = typeutil.NewDuration(defaultCheckRegionSplitInterval) | ||
| } | ||
| if !meta.IsDefined("disable-raw-kv-region-split") { | ||
| c.DisableRawKVRegionSplit = defaultDisableRawKVRegionSplit | ||
| } | ||
| } | ||
|
|
||
| // Clone makes a deep copy of the keyspace config. | ||
|
|
@@ -923,6 +929,11 @@ func (c *KeyspaceConfig) ToWaitRegionSplit() bool { | |
| return c.WaitRegionSplit | ||
| } | ||
|
|
||
| // GetDisableRawKVRegionSplit returns whether to skip raw kv region split. | ||
| func (c *KeyspaceConfig) GetDisableRawKVRegionSplit() bool { | ||
| return c.DisableRawKVRegionSplit | ||
| } | ||
|
|
||
| // GetWaitRegionSplitTimeout returns the max duration to wait region split. | ||
| func (c *KeyspaceConfig) GetWaitRegionSplitTimeout() time.Duration { | ||
| return c.WaitRegionSplitTimeout.Duration | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a keyspace created with
disable-raw-kv-region-split=trueonly has txn bounds. If the config is later changed tofalse, it may never passCheckKeyspaceRegionBoundagain and can become effectively invisible toLoadKeyspace.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the existing keyspace isn't affected by the configuration by design, and later add notes on the user docs.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is intended to be immutable after keyspace creation, can we enforce that in code (for example, reject dynamic updates for this field)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch, I will create new issue to follow it #10572
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to add TODO here?