*: update kvproto to apiv3#11024
Conversation
Signed-off-by: disksing <i@disksing.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe PR updates kvproto and migrates keyspace, GC, TSO, and resource manager code from direct protobuf fields to generated oneof wrappers and getter accessors. Related tests, API serialization, dependency files, and keyspace gRPC compatibility are updated. Changeskvproto oneof migration
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
server/apiv2/handlers/keyspace.go (1)
300-300: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valuePrefer
strconv.FormatUintover castinguint32toint.While casting to
intis safe on 64-bit architectures, it is generally more idiomatic to use unsigned formatting for unsigned integers rather than casting them to signed variants.♻️ Proposed refactor
- resp.NextPageToken = strconv.Itoa(int(scanned[len(scanned)-1].GetId())) + resp.NextPageToken = strconv.FormatUint(uint64(scanned[len(scanned)-1].GetId()), 10)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@server/apiv2/handlers/keyspace.go` at line 300, Update the NextPageToken assignment in the keyspace handler to format scanned[len(scanned)-1].GetId() with strconv.FormatUint, converting it only to the required unsigned integer type and removing the uint32-to-int cast.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pkg/keyspace/keyspace.go`:
- Around line 553-561: Move the manager.keyspaceNameLookup.Store call out of the
RunInTxn callback and perform it only after the enclosing transaction returns
successfully. Keep the storage update inside the transaction, and ensure the
cache is not mutated when the transaction fails or commit encounters a CAS
mismatch.
---
Nitpick comments:
In `@server/apiv2/handlers/keyspace.go`:
- Line 300: Update the NextPageToken assignment in the keyspace handler to
format scanned[len(scanned)-1].GetId() with strconv.FormatUint, converting it
only to the required unsigned integer type and removing the uint32-to-int cast.
🪄 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: 2146e9a5-68fc-4eef-aebb-6a5b35f47316
⛔ Files ignored due to path filters (4)
client/go.sumis excluded by!**/*.sumgo.sumis excluded by!**/*.sumtests/integrations/go.sumis excluded by!**/*.sumtools/go.sumis excluded by!**/*.sum
📒 Files selected for processing (21)
client/clients/tso/stream.goclient/gc_client.goclient/go.modclient/http/types.goclient/keyspace_client.goclient/keyspace_client_test.goclient/servicediscovery/tso_service_discovery.gogo.modpkg/gc/gc_state_manager.gopkg/gc/gc_state_manager_test.gopkg/keyspace/keyspace.gopkg/keyspace/keyspace_test.gopkg/mcs/resourcemanager/server/manager_test.gopkg/storage/keyspace_test.gopkg/utils/tsoutil/tso_proto_factory.goserver/apiv2/handlers/keyspace.goserver/forward.goserver/gc_service.goserver/keyspace_service.gotests/integrations/go.modtools/go.mod
Signed-off-by: disksing <i@disksing.com>
Signed-off-by: disksing <i@disksing.com>
Signed-off-by: disksing <i@disksing.com>
Signed-off-by: disksing <i@disksing.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #11024 +/- ##
==========================================
- Coverage 79.23% 79.21% -0.03%
==========================================
Files 541 540 -1
Lines 76035 76020 -15
==========================================
- Hits 60245 60217 -28
- Misses 11545 11564 +19
+ Partials 4245 4239 -6
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
/test pull-unit-test-next-gen-3 |
Signed-off-by: disksing <i@disksing.com>
Signed-off-by: disksing <i@disksing.com>
Signed-off-by: disksing <i@disksing.com>
Signed-off-by: disksing <i@disksing.com>
Signed-off-by: disksing <i@disksing.com>
Signed-off-by: disksing <i@disksing.com>
|
/test pull-unit-test-next-gen-3 |
9ca1e48 to
a12bf1f
Compare
|
/test pull-unit-test-next-gen-1 |
|
/test pull-unit-test-next-gen-3 |
e3981f2 to
8748a5a
Compare
Signed-off-by: disksing <i@disksing.com>
8748a5a to
0b59efc
Compare
|
/test pull-unit-test-next-gen-2 pull-unit-test-next-gen-3 |
|
/test pull-unit-test-next-gen-2 |
Signed-off-by: disksing <i@disksing.com>
|
/test pull-integration-realcluster-test |
1 similar comment
|
/test pull-integration-realcluster-test |
What problem does this PR solve?
Issue Number: close #11025
The kvproto APIV3 branch changes several keyspace-related protobuf fields to oneofs. PD needs to consume the latest definitions and adapt the affected requests, responses, and test fixtures.
What is changed and how does it work?
Check List
Tests
Code changes
Side effects
Release note
Summary by CodeRabbit