-
Notifications
You must be signed in to change notification settings - Fork 713
ct: track l1 partition size #29482
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: dev
Are you sure you want to change the base?
ct: track l1 partition size #29482
Conversation
053e0f9 to
5fae21e
Compare
Adds an interface to compute the summation of extent sizes for a partition that is managed by the simple metastore. Signed-off-by: Noah Watkins <[email protected]>
578bf5a to
ded128e
Compare
The size is tracked in the metadata_row_value, and the serde version is not incremented because we have not yet released this feature. Updates partition metadata for: * set_start_offset_db_update * add_objects_db_update * replace_objects_db_update Signed-off-by: Noah Watkins <[email protected]>
Signed-off-by: Noah Watkins <[email protected]>
This relies on abstractions introduced at the metastore level in the previous commit which wired everything up, so this can't be squashed into the commit which altered the simple metastore itself. Signed-off-by: Noah Watkins <[email protected]>
Signed-off-by: Noah Watkins <[email protected]>
ded128e to
7406981
Compare
Signed-off-by: Noah Watkins <[email protected]>
Signed-off-by: Noah Watkins <[email protected]>
Signed-off-by: Noah Watkins <[email protected]>
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.
Pull request overview
This PR implements partition size tracking for cloud topics in the L1 metastore, enabling clients to query the total byte size of a partition through a new GetSize RPC endpoint.
Changes:
- Adds a new
GetSizeRPC to the metastore service that returns the total byte size of a partition - Implements size tracking by maintaining a cumulative
sizefield in partition metadata that's updated incrementally during add, replace, and set_start_offset operations - Includes comprehensive test coverage for size calculations across various operations
Reviewed changes
Copilot reviewed 31 out of 31 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| proto/redpanda/core/admin/internal/cloud_topics/v1/metastore.proto | Defines the new GetSize RPC service and request/response messages |
| tests/rptest/clients/admin/proto/redpanda/core/admin/internal/cloud_topics/v1/metastore_pb2*.py* | Generated Python protobuf bindings for the GetSize RPC |
| tests/rptest/tests/cloud_topics/e2e_test.py | Adds end-to-end test verifying GetSize returns correct partition size |
| src/v/redpanda/admin/services/internal/metastore.{h,cc} | Implements admin API handler for GetSize RPC |
| src/v/cloud_topics/level_one/metastore/metastore.h | Adds GetSize method to the metastore interface |
| src/v/cloud_topics/level_one/metastore/simple_metastore.{h,cc} | Implements GetSize for the simple (in-memory) metastore |
| src/v/cloud_topics/level_one/metastore/replicated_metastore.{h,cc} | Implements GetSize for the replicated (production) metastore |
| src/v/cloud_topics/level_one/metastore/state.h | Adds calculate_size helper method for partition state |
| src/v/cloud_topics/level_one/metastore/lsm/values.h | Adds size field to metadata_row_value for persistent size tracking |
| src/v/cloud_topics/level_one/metastore/lsm/state_update.cc | Updates all state update operations to maintain the size field |
| src/v/cloud_topics/level_one/metastore/rpc_types.h | Defines internal RPC types for get_size requests and replies |
| src/v/cloud_topics/level_one/metastore/rpc.json | Registers the get_size RPC method |
| src/v/cloud_topics/level_one/metastore/service.{h,cc} | Implements RPC service handler for get_size |
| src/v/cloud_topics/level_one/metastore/leader_router.{h,cc} | Adds routing logic for get_size requests to the correct leader |
| src/v/cloud_topics/level_one/domain/domain_manager.h | Adds GetSize method to domain manager interface |
| src/v/cloud_topics/level_one/domain/simple_domain_manager.{h,cc} | Implements GetSize for simple domain manager |
| src/v/cloud_topics/level_one/domain/db_domain_manager.{h,cc} | Implements GetSize for database-backed domain manager |
| src/v/cloud_topics/level_one/metastore/tests/simple_metastore_test.cc | Unit tests for GetSize with various scenarios |
| src/v/cloud_topics/level_one/metastore/lsm/tests/state_update_test.cc | Unit tests verifying size tracking during state updates |
| src/v/cloud_topics/level_one/domain/tests/db_domain_manager_test.cc | Integration tests for GetSize at the domain manager level |
| tests/rptest/clients/admin/proto/redpanda/core/admin/internal/cloud_topics/v1/level_zero_gc_pb2*.py* | Updates to GC service protobuf bindings (documentation changes) |
rockwotj
left a comment
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.
lgtm, just one comment on the test could be improved
| return False | ||
|
|
||
| wait_until( | ||
| condition=size_is_positive, |
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.
maybe better to fold this into the retention tests and you can ensure retention book keeps this back to zero properly
Track the size of partitions in L1, and expose that through our internal admin interface.
This is part of a bigger project to support DescribeLogDirs Kafka API for cloud topics, which will require fusing together the metadata tracked in this PR with metadata from L0.
Backports Required
Release Notes