-
Notifications
You must be signed in to change notification settings - Fork 12k
Description
Before Creating the Enhancement Request
- I have confirmed that this should be classified as an enhancement rather than a bug/feature.
Summary
Add a configuration option enableRunningFlagsInFlush to control whether runningFlags should be used during flush operations in CommitLog. This allows users to optionally enable runningFlags validation for message storage reliability when needed.
Motivation
Currently, runningFlags is always passed to MappedFileQueue and MappedFile during initialization, which means runningFlags checks are always performed during flush operations. However, in some scenarios, users may want to disable these checks for specific reasons while maintaining the ability to enable them when message storage reliability is critical.
This enhancement provides more flexibility in controlling the flush behavior and allows users to make informed decisions about when runningFlags validation is necessary for their specific use cases.
Describe the Solution You'd Like
Add a new configuration option enableRunningFlagsInFlush in MessageStoreConfig with default value false
Update CommitLog constructor to conditionally pass runningFlags to MappedFileQueue based on this configuration
Update AllocateMappedFileService to conditionally pass runningFlags to MappedFile based on this configuration
When the configuration is disabled (default), runningFlags will be null during flush operations, bypassing runningFlags checks
When the configuration is enabled, runningFlags will be passed normally, maintaining existing behavior
The implementation should be minimal and focused only on CommitLog since it's responsible for message storage reliability.
Describe Alternatives You've Considered
Always disable runningFlags checks: This would break existing behavior and could impact message storage reliability
Always enable runningFlags checks: This maintains current behavior but doesn't provide the flexibility users might need
Make runningFlags configurable per MappedFileQueue: This would be more complex and overkill for the use case
Add separate configuration for different components: This would add unnecessary complexity when the main concern is CommitLog reliability
The chosen solution provides a simple, centralized way to control runningFlags usage specifically for CommitLog while maintaining backward compatibility through the default value of false.
Additional Context
No response