Skip to content

[release-8.5-keyspace] add option to skip rawkv region bound#10535

Open
bufferflies wants to merge 7 commits intotikv:masterfrom
bufferflies:pr-merge/0c88ce89-skip-rawkv-region-bound
Open

[release-8.5-keyspace] add option to skip rawkv region bound#10535
bufferflies wants to merge 7 commits intotikv:masterfrom
bufferflies:pr-merge/0c88ce89-skip-rawkv-region-bound

Conversation

@bufferflies
Copy link
Copy Markdown
Contributor

@bufferflies bufferflies commented Apr 1, 2026

What problem does this PR solve?

Issue Number: ref #10516,close #10534

author: @zeminzhou

cp 0c88ce89

What is changed and how does it work?

Cherry-pick 0c88ce8921caabfa532e4a2a259bf39f7a49bdd4 onto master and adapt the keyspace region-bound path to the current code structure.

This follow-up removes the temporary disable-raw-kv-region-split switch and derives the bound type directly from key-type:

  • key-type=table -> use txn keyspace bounds
  • key-type=raw -> use raw keyspace bounds
  • key-type=txn -> use raw keyspace bounds

The exported helper surface stays compatible, while the keyspace manager now routes label-rule generation and bound checks through the internal key-type mapping.

Check List

Tests

  • Unit test

Release note

Use `key-type` to derive keyspace region bounds when creating keyspaces. `table` uses txn bounds, while `raw` and `txn` use raw bounds.

Summary by CodeRabbit

  • Refactor
    • Enhanced internal region bound handling to support multiple bound type configurations.
    • Improved region-split operation flow with refined completion tracking.
    • Expanded test coverage for region bound type mappings and label rule generation across different scenarios.

… (tikv#358)

* [release 8.1] cp disable-raw-kv-region-split (tikv#292)

* Add option to skip split rawkv regions (tikv#217)

* add option to skip rawkv region bound

Signed-off-by: AmoebaProtozoa <8039876+AmoebaProtozoa@users.noreply.github.com>

---------

Signed-off-by: AmoebaProtozoa <8039876+AmoebaProtozoa@users.noreply.github.com>

* make check

Signed-off-by: zeminzhou <zhouzemin@pingcap.com>

---------

Signed-off-by: AmoebaProtozoa <8039876+AmoebaProtozoa@users.noreply.github.com>
Signed-off-by: zeminzhou <zhouzemin@pingcap.com>
Co-authored-by: David <8039876+AmoebaProtozoa@users.noreply.github.com>
(cherry picked from commit 0c88ce8)
@ti-chi-bot ti-chi-bot bot added dco-signoff: yes Indicates the PR's author has signed the dco. release-note-none Denotes a PR that doesn't merit a release note. labels Apr 1, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 1, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR refactors keyspace region bound handling by introducing a regionBoundType enum to distinguish between transaction bounds, raw key-value bounds, and both. New helper functions conditionally generate label rules based on the bound type, and region split logic now derives and propagates the appropriate bound type through the validation pipeline.

Changes

Cohort / File(s) Summary
Core Logic Refactoring
pkg/keyspace/keyspace.go
Updated splitKeyspaceRegion to compute bound type and pass it to label rule and wait functions. Refactored waitKeyspaceRegionSplit to accept boundType parameter. Added hasKeyspaceRegionBound(id, boundType) for flexible bound checking and getRegionBoundType() to derive type from cluster config. Changed CheckKeyspaceRegionBound to delegate to the new method. Adjusted defer logic to emit success log only on completion. Removed logutil dependency in favor of zap.Any.
Utility Functions
pkg/keyspace/util.go
Introduced regionBoundType enum with txnRegionBound, rawRegionBound, and allRegionBound variants. Added buildKeyRanges(id, boundType) and buildLabelRule(id, boundType) that conditionally construct key ranges based on bound type. MakeKeyRanges and MakeLabelRule now delegate to these builders with allRegionBound. Added keyTypeToRegionBoundType mapping from key types to bound types.
Test Coverage
pkg/keyspace/util_test.go
Extended TestMakeLabelRule to call buildLabelRule with explicit boundType field and added cases for txnRegionBound and rawRegionBound. New TestKeyTypeToRegionBoundType validates mappings from coreconstant.KeyType values to bound types. Updated TestParseKeyspaceIDFromLabelRule to use buildLabelRule.
Watcher Test Updates
pkg/mcs/scheduling/server/rule/watcher_test.go
Changed test setup to construct LabelRule Data using per-region bounds from keyspace.MakeRegionBound with hex encoding instead of MakeKeyRanges, altering the serialized etcd payloads.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

lgtm

Suggested reviewers

  • rleungx
  • lhy1024

Poem

🐰 With whiskers twitched and nose held high,
We split the bounds with careful eye—
Raw, txn, all in harmony,
Each region split now bounded free!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title '[release-8.5-keyspace] add option to skip rawkv region bound' clearly describes the main feature being added—a new option to skip raw KV region bounds in keyspace creation.
Description check ✅ Passed The PR description includes linked issues, explains the change (cherry-pick + adaptation), details the new behavior, lists unit tests, and provides a release note.
Linked Issues check ✅ Passed The code changes align with the linked issue #10534 objective: implementing key-type-based region bound derivation without exporting the skip-raw behavior in public APIs.
Out of Scope Changes check ✅ Passed All code changes in keyspace.go, util.go, util_test.go, and watcher_test.go are scoped to implementing region-bound type selection and maintaining backward compatibility.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ti-chi-bot ti-chi-bot bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 1, 2026
@bufferflies
Copy link
Copy Markdown
Contributor Author

Review note:

The new DisableRawKVRegionSplit field is tagged as json:"disable-raw-kv-region-split,string" in server/config/config.go. KeyspaceConfig is exported via the config HTTP API, so this makes the field serialize as a JSON string ("true" / "false") instead of a JSON boolean, unlike the sibling wait-region-split field. That changes the API shape for config consumers and is likely to break scripts or clients that expect a boolean.

Please change the tag to json:"disable-raw-kv-region-split" unless there is a specific compatibility requirement for string-encoded booleans here.

@bufferflies
Copy link
Copy Markdown
Contributor Author

Re-review update:

I rechecked the latest delta and the previous finding is resolved.

  • DisableRawKVRegionSplit now uses json:"disable-raw-kv-region-split", so the config HTTP API keeps this field as a JSON boolean instead of a string.
  • The new regression test in server/config/config_test.go exercises the JSON encoding path and verifies that keyspace.disable-raw-kv-region-split is emitted as a bool.

I do not have additional findings on this update. The remaining merge gate is the required make check pass mentioned in the task thread.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
pkg/keyspace/keyspace_test.go (1)

66-92: Add one manager-level test that actually sets DisableRawKVRegionSplit=true.

This mock wiring keeps the suite compiling, but nothing in this file exercises the new waitKeyspaceRegionSplit / CheckKeyspaceRegionBound branch with raw bounds absent. A txn-only-ready case here would catch the behavior this PR is changing.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/keyspace/keyspace_test.go` around lines 66 - 92, The test suite never
sets DisableRawKVRegionSplit on the mockConfig so the new branches in
waitKeyspaceRegionSplit and CheckKeyspaceRegionBound are not exercised; add a
manager-level test that creates/uses mockConfig with
DisableRawKVRegionSplit=true (via GetDisableRawKVRegionSplit) and drives the
manager code paths that call waitKeyspaceRegionSplit and
CheckKeyspaceRegionBound (simulate/prepare a txn-only-ready keyspace with raw
bounds missing) so the branch that handles raw-bounds-absent behavior executes
and asserts expected outcome.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@pkg/keyspace/util.go`:
- Around line 129-130: The rename of makeKeyRanges to an unexported identifier
breaks external callers; either restore an exported wrapper MakeKeyRanges(id
uint32, skipRaw bool) that calls the new makeKeyRanges, or update all external
call sites to use the unexported symbol (preferred if migrating within the same
package). Add an exported function named MakeKeyRanges that forwards its
arguments to makeKeyRanges (preserving signature and behavior) so tools/pd-ctl
callers (e.g., keyspace.MakeKeyRanges) keep building, or alternatively change
those callers to call the new unexported implementation and remove the wrapper.

---

Nitpick comments:
In `@pkg/keyspace/keyspace_test.go`:
- Around line 66-92: The test suite never sets DisableRawKVRegionSplit on the
mockConfig so the new branches in waitKeyspaceRegionSplit and
CheckKeyspaceRegionBound are not exercised; add a manager-level test that
creates/uses mockConfig with DisableRawKVRegionSplit=true (via
GetDisableRawKVRegionSplit) and drives the manager code paths that call
waitKeyspaceRegionSplit and CheckKeyspaceRegionBound (simulate/prepare a
txn-only-ready keyspace with raw bounds missing) so the branch that handles
raw-bounds-absent behavior executes and asserts expected outcome.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: db1a2dcf-698f-41aa-b67d-e062dea57b9f

📥 Commits

Reviewing files that changed from the base of the PR and between 5e71b3a and 0ef292c.

📒 Files selected for processing (6)
  • pkg/keyspace/keyspace.go
  • pkg/keyspace/keyspace_test.go
  • pkg/keyspace/util.go
  • pkg/keyspace/util_test.go
  • pkg/mcs/scheduling/server/rule/watcher_test.go
  • server/config/config.go

Signed-off-by: bufferflies <1045931706@qq.com>
@bufferflies bufferflies force-pushed the pr-merge/0c88ce89-skip-rawkv-region-bound branch from cea718f to 4473520 Compare April 1, 2026 03:21
@bufferflies
Copy link
Copy Markdown
Contributor Author

Review note:

makeKeyRanges should stay public and keep returning []any. In the current patch it was changed from MakeKeyRanges(id uint32) []any to makeKeyRanges(id uint32, skipRaw bool) any, which unnecessarily regresses both API visibility and type precision.

Even if current call sites are internal, this helper was previously exported and had a concrete return type. Please keep the exported helper and preserve the []any return type, then layer the new skipRaw behavior without widening the signature to any.

Signed-off-by: bufferflies <1045931706@qq.com>
@bufferflies
Copy link
Copy Markdown
Contributor Author

Review note:

This is only a partial compatibility fix. MakeKeyRanges is public again and the return type is back to []any, but its exported signature still changed from MakeKeyRanges(id uint32) []any to MakeKeyRanges(id uint32, skipRaw bool) []any.

That is still a breaking API change for any existing caller that uses the old one-argument form. If compatibility is the goal, the old exported signature should remain available. A safer shape would be to keep MakeKeyRanges(id uint32) []any with the original behavior and add a new helper for the skip-raw variant (or keep the skip-raw helper internal).

Signed-off-by: bufferflies <1045931706@qq.com>
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
tools/pd-ctl/pdctl/command/keyspace_command_test.go (1)

41-74: Consider adding test coverage for skipRaw=true.

The test correctly validates the skipRaw=false behavior. However, the new skipRaw=true path is not covered in this test file. Adding a test case that verifies MakeKeyRanges(keyspaceID, true) returns only 1 range (txn-only) would improve coverage of the new functionality.

💡 Example test case for skipRaw=true
func TestMakeKeyRangesSkipRaw(t *testing.T) {
	re := require.New(t)

	keyspaceID := uint32(1)
	ranges := keyspace.MakeKeyRanges(keyspaceID, true)
	re.Len(ranges, 1, "should have 1 range (txn only) when skipRaw=true")

	// Verify txn key range
	txnRange := ranges[0].(map[string]any)
	txnStart := txnRange["start_key"].(string)
	txnEnd := txnRange["end_key"].(string)
	re.NotEmpty(txnStart)
	re.NotEmpty(txnEnd)

	// Verify the encoding matches the expected txn format
	keyspaceIDBytes := make([]byte, 4)
	nextKeyspaceIDBytes := make([]byte, 4)
	binary.BigEndian.PutUint32(keyspaceIDBytes, keyspaceID)
	binary.BigEndian.PutUint32(nextKeyspaceIDBytes, keyspaceID+1)

	expectedTxnLeft := codec.EncodeBytes(append([]byte{'x'}, keyspaceIDBytes[1:]...))
	expectedTxnRight := codec.EncodeBytes(append([]byte{'x'}, nextKeyspaceIDBytes[1:]...))

	re.Equal(hex.EncodeToString(expectedTxnLeft), txnStart)
	re.Equal(hex.EncodeToString(expectedTxnRight), txnEnd)
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tools/pd-ctl/pdctl/command/keyspace_command_test.go` around lines 41 - 74,
Add a unit test covering the new skipRaw=true path: call
keyspace.MakeKeyRanges(keyspaceID, true) in keyspace_command_test.go (similar
structure to existing loop test) and assert it returns exactly 1 range
(txn-only); verify the returned map uses keys "start_key"/"end_key" and that
encoded txn boundaries equal codec.EncodeBytes(append([]byte{'x'}, ...)) for
keyspaceID and keyspaceID+1 as done in the existing assertions for the txn
range.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@tools/pd-ctl/pdctl/command/keyspace_command_test.go`:
- Around line 41-74: Add a unit test covering the new skipRaw=true path: call
keyspace.MakeKeyRanges(keyspaceID, true) in keyspace_command_test.go (similar
structure to existing loop test) and assert it returns exactly 1 range
(txn-only); verify the returned map uses keys "start_key"/"end_key" and that
encoded txn boundaries equal codec.EncodeBytes(append([]byte{'x'}, ...)) for
keyspaceID and keyspaceID+1 as done in the existing assertions for the txn
range.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c0f0db76-96c4-42eb-b36e-91f8e6678652

📥 Commits

Reviewing files that changed from the base of the PR and between 4473520 and 4a19d98.

📒 Files selected for processing (4)
  • pkg/keyspace/keyspace.go
  • pkg/keyspace/util.go
  • tools/pd-ctl/pdctl/command/keyspace_command.go
  • tools/pd-ctl/pdctl/command/keyspace_command_test.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • pkg/keyspace/keyspace.go

@bufferflies
Copy link
Copy Markdown
Contributor Author

Review note:

There is still another compatibility regression in the same area: MakeLabelRule was also changed from an exported helper to the private makeLabelRule.

Even though the current discussion focused on MakeKeyRanges, this has the same compatibility risk pattern: a previously exported helper became private as part of the refactor. If compatibility is the goal, MakeLabelRule should also keep its exported surface, or there needs to be a very explicit decision that this API break is acceptable.

Signed-off-by: bufferflies <1045931706@qq.com>
@bufferflies
Copy link
Copy Markdown
Contributor Author

/check-issue-triage-complete

@bufferflies
Copy link
Copy Markdown
Contributor Author

Re-review update:

I rechecked the latest delta and the MakeLabelRule compatibility issue is resolved.

  • MakeLabelRule(id uint32) is exported again.
  • The skip-raw behavior stays behind internal helpers instead of changing the exported helper signature.
  • This is aligned with the compatibility expectation discussed in the thread.

I do not have an additional compatibility finding on this specific follow-up change.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

❌ Patch coverage is 78.12500% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.96%. Comparing base (3eb99ae) to head (bff1863).
⚠️ Report is 16 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #10535      +/-   ##
==========================================
+ Coverage   78.88%   78.96%   +0.08%     
==========================================
  Files         530      531       +1     
  Lines       71548    71655     +107     
==========================================
+ Hits        56439    56584     +145     
+ Misses      11092    11057      -35     
+ Partials     4017     4014       -3     
Flag Coverage Δ
unittests 78.96% <78.12%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bufferflies
Copy link
Copy Markdown
Contributor Author

/ping @AmoebaProtozoa @rleungx

@bufferflies bufferflies requested a review from rleungx April 2, 2026 02:10
@@ -576,7 +577,15 @@ func (manager *Manager) waitKeyspaceRegionSplit(id uint32) error {

// CheckKeyspaceRegionBound checks whether the keyspace region has been split.
func (manager *Manager) CheckKeyspaceRegionBound(id uint32) bool {
Copy link
Copy Markdown
Contributor

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=true only has txn bounds. If the config is later changed to false, it may never pass CheckKeyspaceRegionBound again and can become effectively invisible to LoadKeyspace.

Copy link
Copy Markdown
Contributor Author

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.

Copy link
Copy Markdown
Contributor

@lhy1024 lhy1024 Apr 3, 2026

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)?

Copy link
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
Contributor

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?

@ti-chi-bot
Copy link
Copy Markdown
Contributor

ti-chi-bot bot commented Apr 3, 2026

@AmoebaProtozoa: adding LGTM is restricted to approvers and reviewers in OWNERS files.

Details

In response to this:

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@bufferflies bufferflies requested a review from lhy1024 April 3, 2026 03:16
@ti-chi-bot ti-chi-bot bot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Apr 3, 2026
@ti-chi-bot ti-chi-bot bot removed the release-note-none Denotes a PR that doesn't merit a release note. label Apr 3, 2026
Copy link
Copy Markdown
Contributor

@lhy1024 lhy1024 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the rest LGTM

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Apr 8, 2026
@ti-chi-bot
Copy link
Copy Markdown
Contributor

ti-chi-bot bot commented Apr 8, 2026

[LGTM Timeline notifier]

Timeline:

  • 2026-04-08 03:22:38.945045323 +0000 UTC m=+926564.150405370: ☑️ agreed by lhy1024.

defaultGCTunerThreshold = 0.6
minGCTunerThreshold = 0
maxGCTunerThreshold = 0.9
defaultDisableRawKVRegionSplit = false
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we change to enablexxx?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may introduce configuration compatibility issues.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But usually we use enablexxx for a switch.

Signed-off-by: bufferflies <1045931706@qq.com>
@ti-chi-bot
Copy link
Copy Markdown
Contributor

ti-chi-bot bot commented Apr 15, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: AmoebaProtozoa, lhy1024

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added the approved label Apr 15, 2026
}

func (manager *Manager) getRegionBoundType() regionBoundType {
if manager.cluster == nil || manager.cluster.GetSharedConfig() == nil {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fallback looks risky. If cluster exists but GetSharedConfig() is temporarily nil / unavailable, we now silently fall back to table -> txn bound, which changes the old behavior from "check all bounds" to txn-only. That can misclassify non-table deployments and generate the wrong label rule / split check before shared config is ready. Please either keep an explicit "unknown -> allRegionBound" fallback here, or make the caller fail closed until the key type is available instead of defaulting to Table.

Signed-off-by: bufferflies <1045931706@qq.com>
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
pkg/keyspace/keyspace.go (1)

579-604: ⚠️ Potential issue | 🟠 Major

Don’t re-derive region bounds from the live shared config.

CheckKeyspaceRegionBound now uses the current GetSharedConfig().GetKeyType() every time. That means a keyspace created with txn-only bounds can later fail LoadKeyspace if the shared config changes, and the nil fallback here silently picks txnRegionBound as well. This contradicts the “only new keyspaces are affected” behavior described for the feature. The bound type needs to come from the keyspace’s creation-time choice (or other persisted metadata), not from the current cluster config.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/keyspace/keyspace.go` around lines 579 - 604, CheckKeyspaceRegionBound
currently derives the region bound type from live config via
getRegionBoundType(), which can change over time; instead use the keyspace's
persisted creation-time bound metadata (e.g., a field or method on the keyspace
record) when deciding bounds. Update
CheckKeyspaceRegionBound/hasKeyspaceRegionBound to fetch the stored bound type
from the keyspace object (for example use keyspace.RegionBoundType or
keyspace.GetRegionBoundType()) rather than calling manager.getRegionBoundType(),
and remove/adjust the nil/shared-config fallback so it never re-derives bounds
from the cluster config at runtime.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@pkg/keyspace/keyspace.go`:
- Around line 579-604: CheckKeyspaceRegionBound currently derives the region
bound type from live config via getRegionBoundType(), which can change over
time; instead use the keyspace's persisted creation-time bound metadata (e.g., a
field or method on the keyspace record) when deciding bounds. Update
CheckKeyspaceRegionBound/hasKeyspaceRegionBound to fetch the stored bound type
from the keyspace object (for example use keyspace.RegionBoundType or
keyspace.GetRegionBoundType()) rather than calling manager.getRegionBoundType(),
and remove/adjust the nil/shared-config fallback so it never re-derives bounds
from the cluster config at runtime.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 63def982-4199-4bbe-a19e-ed88981d1090

📥 Commits

Reviewing files that changed from the base of the PR and between bff1863 and 340c62e.

📒 Files selected for processing (3)
  • pkg/keyspace/keyspace.go
  • pkg/keyspace/util.go
  • pkg/keyspace/util_test.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • pkg/keyspace/util.go

@ti-chi-bot
Copy link
Copy Markdown
Contributor

ti-chi-bot bot commented Apr 15, 2026

@bufferflies: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-unit-test-next-gen-2 edcbc90 link true /test pull-unit-test-next-gen-2
pull-unit-test-next-gen-1 edcbc90 link true /test pull-unit-test-next-gen-1

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved dco-signoff: yes Indicates the PR's author has signed the dco. needs-1-more-lgtm Indicates a PR needs 1 more LGTM. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0c88ce89 add option to skip rawkv region bound

5 participants