HDDS-15562. EventNotification: persistence strategy for consumer checkpoint (via distributed RocksDB update)#10689
Open
gardenia wants to merge 1 commit into
Conversation
Author
|
NOTE: this is a rework of the original implementation which used Ozone filesystem bucket property metadata to store the properties (PR and review comments from @ChenSammi can be found here #10515). This approach of using a distributed write to the RocksDB metadata table for persisting the checkpoint was suggested by @ChenSammi in review comments you can find on the above PR. |
Persist the checkpoint within the OM RocksDB metadata table using a distributed Ratis update message so that another OM can pick up if the leader changes. Technical Solution: * Update the RocksDB metadata table (OMSetEventNotificationCheckpointRequest) and distribute this to other OMs via Ratis (SetEventNotificationCheckpointRequest) Checkpoint Throttling: * We update our local progress in-memory on every transaction batch, but throttle the persistent Ratis writes (configurable via OZONE_OM_PLUGIN_CHECKPOINT_SAVE_INTERVAL, defaulting to every 100 transactions). * The intent is to prevent saturating the Ratis log or causing write storms on RocksDB while maintain our at-least-once delivery guarantee. * If a Ratis write fails, throttling is bypassed to ensure the next update cycle retries immediately. Error Handling: * Both loading and saving failures are non-blocking for background polling progress * On load failures, we log a warning and fallback to starting from transaction 0/null. * On save failures, we log a warning but always advance progress in-memory to ensure progress but conform to at-least-once event delivery. Detailed Changes: - Protobuf: - Add SetEventNotificationCheckpoint type and request/response payloads to OmClientProtocol.proto. - OmUtils & OzoneManagerRatisUtils: - Wire SetEventNotificationCheckpoint as a write request. - Route SetEventNotificationCheckpoint to its corresponding OMRequest class. - Requests & Responses: - Create OMSetEventNotificationCheckpointRequest to write checkpoint values to metaTable. - Create OMSetEventNotificationCheckpointResponse to persist values in metaTable via addToDBBatch. - Strategy: - Expose NotificationCheckpointStrategy interface with load, save, and reset. - Implement OzoneDbCheckpointStrategy to query and save checkpoints atomically via the new OM requests. - Added reset() call to durably clear checkpoints during self-healing. - Plugin Context & Poller: - Wire the checkpoint strategy through OMEventListenerPluginContext and OMEventListenerPluginManager. - Integrate strategy into the poller and publisher. Both loading and saving failures are non-blocking, falling back to starting from 0/null on load failures and continuing in-memory progress on save failures.
8936a16 to
2ed2e10
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.
Please describe your PR in detail:
Persist the checkpoint within the OM RocksDB metadata table using a distributed Ratis update message so that another OM can pick up if the leader changes.
Technical Solution:
Checkpoint Throttling:
Error Handling:
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-15562
How was this patch tested?
Unit tests