feat(meta): add KvList gRPC API for listing keys by prefix - #19235
Merged
Conversation
drmingdrmer
force-pushed
the
345-grpc-list
branch
2 times, most recently
from
January 12, 2026 06:50
006f015 to
8af4b17
Compare
xp-trumpet
reviewed
Jan 12, 2026
xp-trumpet
left a comment
Collaborator
There was a problem hiding this comment.
@xp-trumpet reviewed 12 files and all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @drmingdrmer).
drmingdrmer
force-pushed
the
345-grpc-list
branch
from
January 12, 2026 06:55
8af4b17 to
f80c6bb
Compare
xp-trumpet
reviewed
Jan 12, 2026
xp-trumpet
left a comment
Collaborator
There was a problem hiding this comment.
@xp-trumpet reviewed 1 file and all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @drmingdrmer).
Improve the CLI help messages for all `metactl` subcommands by adding usage examples and sample output. This helps users understand how to use each command without referring to external documentation. Changes: - Add description, example usage, and sample output for all 16 subcommands - Use `#[command(verbatim_doc_comment)]` to preserve formatting in help text - Include multiple examples where commands have different usage patterns
Add streaming `KvList` RPC that lists key-value pairs matching a prefix. Requires leadership - non-leaders return error with leader endpoint in metadata. Changes: - Add `KvList` RPC to `MetaService` proto with `KvListRequest` message - Add `kv_list()` method to `MetaLeader` for listing keys from state machine - Add `handle_kv_list()` to `MetaNode` with leader check and redirect - Add `status_forward_to_leader()` to `GrpcHelper` for error responses - Refactor `GrpcHelper` to share metadata parsing logic - Add `kv_list()` to `EstablishedClient` - Add integration tests for leader, follower redirect, and no-quorum scenarios
…ernal_resets` error The h2 library has a default limit of 1024 locally-reset streams per connection. When this limit is reached, h2 sends a GoAway frame with ENHANCE_YOUR_CALM error and `too_many_internal_resets` message. This can happen under high concurrency when streams are cancelled or dropped before completion. This fix adds a connection TTL (default 20 seconds) to force periodic reconnection, preventing stream reset accumulation on long-lived connections. Changes: - Add `created_instant` field to `EstablishedClient` for TTL tracking - Add `is_expired()` method to check connection age - Add `connection_ttl` field to `MetaChannelManager` (default: 20s) - Check TTL in `MetaChannelManager::check()` and reject expired connections - Configure server-side `http2_max_pending_accept_reset_streams(4096)` as safety measure
drmingdrmer
force-pushed
the
345-grpc-list
branch
from
January 12, 2026 10:25
f80c6bb to
48936a4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/
Summary
feat(meta): add
KvListgRPC API for listing keys by prefixAdd streaming
KvListRPC that lists key-value pairs matching a prefix.Requires leadership - non-leaders return error with leader endpoint in metadata.
Changes:
KvListRPC toMetaServiceproto withKvListRequestmessagekv_list()method toMetaLeaderfor listing keys from state machinehandle_kv_list()toMetaNodewith leader check and redirectstatus_forward_to_leader()toGrpcHelperfor error responsesGrpcHelperto share metadata parsing logickv_list()toEstablishedClientdocs: add examples and sample output to metactl subcommand help
Improve the CLI help messages for all
metactlsubcommands by addingusage examples and sample output. This helps users understand how to
use each command without referring to external documentation.
Changes:
#[command(verbatim_doc_comment)]to preserve formatting in help textTests
Type of change
Related Issues
This change is