-
Notifications
You must be signed in to change notification settings - Fork 685
feat(ddl): Implement database-level barrier and checkpoint configuration - Part 2 #22178
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
Conversation
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 adds support for per-database barrier intervals and checkpoint frequencies by extending DDL, catalog controller, and the barrier scheduler.
- DDL controller now notifies the global barrier manager on database creation and alteration.
- Catalog controller methods return the internal database model for barrier configuration.
- The barrier scheduler/store is refactored to maintain per-database timer streams and state updates.
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
src/meta/src/rpc/ddl_controller.rs | Notify GlobalBarrierManager on create/alter database ops |
src/meta/src/controller/catalog/create_op.rs | Change create_database to return the database model |
src/meta/src/controller/catalog/alter_op.rs | Change alter_database_param to return the database model |
src/meta/src/barrier/worker.rs | Bootstrap and recovery use per-database PeriodicBarriers |
src/meta/src/barrier/schedule.rs | Refactor scheduling to use IntervalStream per database |
src/meta/src/barrier/mod.rs | Add UpdateDatabaseBarrier request variant |
src/meta/src/barrier/manager.rs | Expose update_database_barrier API |
src/meta/src/barrier/context/recovery.rs | Include database_infos in recovery snapshot |
src/common/src/catalog/mod.rs | Derive Clone /Debug for AlterDatabaseParam |
Comments suppressed due to low confidence (2)
src/meta/src/barrier/schedule.rs:357
- Per-database scheduling logic is introduced here; consider adding unit tests to cover
PeriodicBarriers::new
andnext_barrier
to validate interval streams and checkpoint logic for multiple databases.
pub(super) fn new(
src/meta/src/barrier/manager.rs:90
- Public API
update_database_barrier
is added; please add a Rustdoc comment describing its purpose, parameters, and failure modes to aid future maintainers.
pub fn update_database_barrier(
7f4dba8
to
2ca8d2a
Compare
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.
Needs to handle the unresolved comments.
Please also update the release note in the |
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.
The added unit tests look flaky. May need some way to make it more stable.
affa33b
to
200d132
Compare
19091bc
to
3911042
Compare
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
This PR makes the per-database
barrier_interval_ms
andcheckpoint_frequency
settings work.Following up on PR #22052 which set up the API and storage, this change modifies the
GlobalBarrierWorker
(especially inPeriodicBarriers
) in meta service to schedule and inject barriers according to each database's specific configuration. Databases without custom settings will fall back to the globalSystemParams
.To verify the new scheduling logic, focused unit tests have been added to the
PeriodicBarriers
component.Related Issues
Checklist
Documentation
Release note
Users can now configure
barrier_interval_ms
andcheckpoint_frequency
for each database individually, providing more granular control over latency and resource consumption within a single RisingWave cluster.Previously, these settings were global, forcing all databases to share the same configuration. This change is particularly impactful for users running diverse workloads. If no specific values are set for a database, it will automatically use the global settings defined in
SystemParams
, ensuring backward compatibility and a seamless experience for existing users.You can configure these settings using the following SQL commands:
On creation:
For existing databases:
To revert to the global default: