Improve quorum queue Ra system configurability#15962
Conversation
3184402 to
3b4492f
Compare
There was a problem hiding this comment.
Pull request overview
Adds configurability for Raft log segment max size for quorum queues by introducing a raft.segment_max_size_bytes setting in rabbitmq.conf and wiring it through RabbitMQ’s config schema into the quorum-queues Ra system configuration.
Changes:
- Add a new Cuttlefish schema mapping/translation for
raft.segment_max_size_bytes. - Pass
segment_max_size_bytesinto thequorum_queuesRa system config (with a default macro). - Extend schema tests and the example
rabbitmq.confwith the new setting.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| deps/rabbit/test/config_schema_SUITE_data/rabbit.snippets | Adds a schema snippet asserting raft.segment_max_size_bytes maps into the RabbitMQ app env. |
| deps/rabbit/src/rabbit_ra_systems.erl | Reads rabbit.quorum_segment_max_size_bytes and injects segment_max_size_bytes into the quorum queues Ra system config. |
| deps/rabbit/priv/schema/rabbit.schema | Introduces mapping/translation for raft.segment_max_size_bytes. |
| deps/rabbit/docs/rabbitmq.conf.example | Documents the new raft.segment_max_size_bytes option in the Raft settings section. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
3b4492f to
d4b664c
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d4b664c to
48825ac
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add support for configuring Ra's segment_max_size_bytes parameter via rabbitmq.conf as raft.segment_max_size_bytes. This allows operators to control the maximum size of Raft log segment files for quorum queues. The configuration: - Maps quorum_queue.segment_max_size_bytes in rabbitmq.conf to rabbit.quorum_segment_max_size_bytes in the application environment - Defaults to Ra's built-in default of 64 MB when not configured - Is explicitly applied to the quorum_queues Ra system configuration for transparency and maintainability Also add a macro QUORUM_DEFAULT_SEGMENT_MAX_SIZE_B to align with Ra's default value.
48825ac to
eacdd0c
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ab1b76a to
607448d
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1265826 to
8b6bb2f
Compare
8b6bb2f to
fd35cd7
Compare
73280ee to
c970f7d
Compare
…urable Add support for configuring all quorum queue Ra system parameters via rabbitmq.conf using the quorum_queue.* namespace. This allows operators to fine-tune Raft log and WAL behavior specifically for quorum queues. New quorum_queue.* configuration options: - quorum_queue.wal_compute_checksums (default: true) - quorum_queue.segment_compute_checksums (default: true) - quorum_queue.max_append_entries_rpc_batch_size (default: 16) - quorum_queue.compress_mem_tables (default: true) - quorum_queue.segment_max_size_bytes (default: 64 MB) - quorum_queue.segment_max_entries (default: 4096) - quorum_queue.wal_max_size_bytes (default: 512 MB) - quorum_queue.wal_max_entries (default: 500,000) - quorum_queue.wal_max_batch_size (default: 4096) - quorum_queue.snapshot_chunk_size (default: 1 MB) Each quorum_queue.* setting has a fallback to the corresponding raft.* setting for backward compatibility with existing configurations. All configuration is mapped to rabbit application environment variables and explicitly applied to the quorum_queues Ra system during initialization, making the data flow transparent and maintainable. Add macros for all default values that match the RabbitMQ prelaunch defaults, centralizing configuration defaults in one place for easier maintenance. Simplify WalMaxEntries handling to use application:get_env with macro default instead of complex case statement checking DefaultConfig.
c970f7d to
42927f0
Compare
Improve quorum queue Ra system configurability (backport #15962)
Expose all coordination Ra system parameters through new coordination.* configuration options, following the pattern established in PR #15962 for quorum queues. This allows operators to fine-tune Raft log and WAL behavior specifically for the coordination system without affecting other Ra-based systems (quorum queues, Khepri). New coordination.* configuration options: - coordination.wal_compute_checksums (default: true) - coordination.segment_compute_checksums (default: true) - coordination.wal_max_size_bytes (default: 64 MB) - coordination.wal_max_entries (default: from Ra's default_config) - coordination.wal_max_batch_size (default: from Ra's default_config) - coordination.segment_max_size_bytes (default: from Ra's default_config) - coordination.segment_max_entries (default: from Ra's default_config) - coordination.max_append_entries_rpc_batch_size (default: from Ra's default_config) - coordination.compress_mem_tables (default: true) - coordination.snapshot_chunk_size (default: from Ra's default_config) Each coordination.* setting has a fallback to its default value, ensuring backward compatibility. The wal_max_size_bytes parameter maintains the existing hardcoded default of 64 MB. Implementation details: 1. Added macros for coordination defaults in rabbit_ra_systems.erl 2. Refactored get_config(coordination) to read from application environment variables with sensible defaults, matching the quorum_queues pattern 3. Added Cuttlefish schema mappings for all new configuration options 4. Added comprehensive documentation in rabbitmq.conf.example 5. Added schema validation tests in rabbit.snippets 6. Added dedicated test suite (rabbit_ra_systems_SUITE) to validate defaults All configuration is explicitly passed to the coordination Ra system during initialization, making the data flow transparent and maintainable. Backward compatibility: Existing deployments continue to work unchanged, with coordination.wal_max_size_bytes defaulting to 64 MB.
Summary
Make all quorum queue Ra configuration parameters explicit and configurable via
rabbitmq.conf.This PR expands on the initial work to make segment sizing configurable by exposing all quorum queue Ra system parameters through the
quorum_queue.*configuration namespace. This allows operators to fine-tune Raft log and WAL behavior specifically for quorum queues, with backward compatibility for the legacyraft.*configuration options.Motivation
Previously, quorum queue Ra system parameters could only be configured via the global
raft.*settings or the pre-launch default configuration. This PR provides dedicatedquorum_queue.*configuration options that:raft.*configurationsChanges
New
quorum_queue.*Configuration Optionsquorum_queue.segment_max_size_bytes(default: 64 MB)quorum_queue.segment_max_entries(default: 4096)quorum_queue.wal_max_size_bytes(default: 512 MB)quorum_queue.wal_max_entries(default: 500,000)quorum_queue.wal_max_batch_size(default: 4096)quorum_queue.wal_compute_checksums(default: true)quorum_queue.segment_compute_checksums(default: true)quorum_queue.max_append_entries_rpc_batch_size(default: 16)quorum_queue.compress_mem_tables(default: true)quorum_queue.snapshot_chunk_size(default: 1 MB)Implementation Details
quorum_queue.*setting that map to rabbit application environment variablesquorum_queue.*setting falls back to the correspondingraft.*setting if not explicitly configuredWalMaxEntrieshandling to useapplication:get_envwith macro defaults instead of complex case statement logicFiles Changed
deps/rabbit/src/rabbit_ra_systems.erl: Updated to read quorum_queue configuration and apply defaults via macrosdeps/rabbit/priv/schema/rabbit.schema: Added mappings and translations for all quorum_queue.* settingsdeps/rabbit/docs/rabbitmq.conf.example: Documented all new configuration optionsdeps/rabbit/test/config_schema_SUITE_data/rabbit.snippets: Added test coverage for all new settingsTest Plan
raft.*settingsNotes
rabbit_prelaunch_conf.erl