You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "gardenia (via GitHub)" <gi...@apache.org> on 2025/09/08 14:53:36 UTC
[PR] HDDS-5984. Ozone Event Notification [ozone]
gardenia opened a new pull request, #9012:
URL: https://github.com/apache/ozone/pull/9012
Please describe your PR in detail:
A rough draft implementation of this outline:
https://github.com/apache/ozone/pull/8871#issuecomment-3177110525
NOTE: This PR is not intended to be ready for merging but is being shared as a way to get early feedback on the gist of the approach and help drive the discussion of the design (https://github.com/apache/ozone/pull/8871) There are many TODOs, rough edges and things that need to be fleshed out.
There are 2 logical parts:
1. in OzoneManagerStateMachine when certain write operations complete successfully a summary of that operation is written to a new rocksdb "ledger" table named OperationInfo
The current OperationInfo schema is minimal:
/**
* OperationInfo table entry for completed operation info
*/
message OperationInfo {
optional int64 trxLogIndex = 1;
required Type cmdType = 2; // Type of the command
optional string volumeName = 3;
optional string bucketName = 4;
optional string keyName = 5;
optional uint64 creationTime = 6;
optional CreateKeyOperationArgs createKeyArgs = 7;
optional RenameKeyOperationArgs renameKeyArgs = 8;
optional DeleteKeyOperationArgs deleteKeyArgs = 9;
optional CommitKeyOperationArgs commitKeyArgs = 10;
optional CreateDirectoryOperationArgs createDirectoryArgs = 11;
optional CreateFileOperationArgs createFileArgs = 12;
}
The use of "optional" for the arguments was based on feedback from the community call where @errose28 made the point that the previous sketch of a schema (using a freeform Map<String, String>) did not jibe well with schema management and this optional pattern had been used in other places to get around that.
2. there is then a concept of an "event listener" plugin which can consume the records in the OperationInfo table.
* plugins implement a new interface: OMEventListener
* a helper class OMEventListenerLedgerPoller is provided which plugin implementations can use to periodically poll for newly written OperationInfo records table and passes them them to a callback.
* OMEventListenerKafkaPublisher is a concrete implementation of OMEventListener which consumes the latest Operationinfo records, serializes them to appropriate S3 style event notification and sends them to a configured kafka broker.
* there is a draft implementation of a persistence strategy for the seek position (i.e. the latest OperationInfo consumed and processed by the plugin)called LocalFilePersistenceStrategy. This is an ultimately flawed approach in the case of leader changes but still meets the minimal criteria of "at least once" until we implement something better.
* there is a crude strawman/draft implementation of a strategy to rotate out old records for the ledger based on number of rows. This needs fleshed out and made robust/efficient.
* plugins can be loaded/configured dynamically similarly to ranger plugins, e.g.:
```
ozone.om.plugin.destination.kafka=true
ozone.om.plugin.destination.kafka.classname=org.apache.hadoop.ozone.om.eventlistener.OMEventListenerKafkaPublisheozone.notify.kafka.topic=test123
ozone.notify.kafka.bootstrap.servers=kafka-3:29092,kafka-1:29092,kafka-2:29092
```
TODO:
* move the eventlistener package out of ozone-manager into some separate package (NOTE: currently there is a dependency on OzoneManager which is required to determine if we are the leader)
* implement a better persistence strategy for the seek position (e.g. write to a file on the ozone filesystem instead of a file local to the OM)
* flesh out/redo the strategy to rotate out old records from the ledger table
* need to work out how to fit ACLs into the ledger schema
* more unit tests
## What is the link to the Apache JIRA
http://issues.apache.org/jira/browse/HDDS-5984
## How was this patch tested?
unit tests, manual tests (docker compose)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-13513. Ozone Event Notification [ozone]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #9012:
URL: https://github.com/apache/ozone/pull/9012#issuecomment-4585256209
This PR has been marked as stale due to 21 days of inactivity. Please comment or remove the stale label to keep it open. Otherwise, it will be automatically closed in 7 days.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-13513. Ozone Event Notification [ozone]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #9012:
URL: https://github.com/apache/ozone/pull/9012#issuecomment-3781757183
Thank you for your contribution. This PR is being closed due to inactivity. If needed, feel free to reopen it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-13513. Ozone Event Notification [ozone]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #9012: HDDS-13513. Ozone Event Notification
URL: https://github.com/apache/ozone/pull/9012
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-13513. Ozone Event Notification [ozone]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #9012:
URL: https://github.com/apache/ozone/pull/9012#issuecomment-3573218355
This PR has been marked as stale due to 21 days of inactivity. Please comment or remove the stale label to keep it open. Otherwise, it will be automatically closed in 7 days.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-13513. Ozone Event Notification [ozone]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #9012:
URL: https://github.com/apache/ozone/pull/9012#issuecomment-5228905448
Thank you for your contribution. This PR is being closed due to inactivity. Please contact a maintainer if you would like to reopen it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-13513. Ozone Event Notification [ozone]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #9012:
URL: https://github.com/apache/ozone/pull/9012#issuecomment-3684593623
This PR has been marked as stale due to 21 days of inactivity. Please comment or remove the stale label to keep it open. Otherwise, it will be automatically closed in 7 days.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-13513. Ozone Event Notification [ozone]
Posted by "smengcl (via GitHub)" <gi...@apache.org>.
smengcl commented on PR #9012:
URL: https://github.com/apache/ozone/pull/9012#issuecomment-4931703455
### Code review
This is an early-stage design/feedback PR (author's own description: "not intended to be ready for merging"). Reviewing in that spirit. Note that PR #8871 by a different author also implements HDDS-13513 -- the community will need to reconcile which design to pursue before either can land.
Found 4 issues:
1. `equals()` compares the wrong fields with `==` instead of `.equals()`, making the method return incorrect results for most inputs.
```java
volumeName == that.bucketName && // wrong: reference equality and wrong field pairing
```
https://github.com/apache/ozone/blob/047e955d4b23202bad7f9e0b4a6ac9d8a56608c2/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmCompletedRequestInfo.java#L373-L380
2. `CompletedRequestInfoCleanupService` calls `deleteRange(firstKey, lastKey)` but RocksDB `deleteRange` is end-exclusive (`[first, last)`), so the last record intended for deletion is always skipped. The table grows by 1 row every cleanup cycle. The single-key path (`delete(firstKey)`) is correct; the range path needs `deleteRange(firstKey, keyAfterLast)` or an explicit delete of `lastKey` after the range call.
https://github.com/apache/ozone/blob/047e955d4b23202bad7f9e0b4a6ac9d8a56608c2/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/CompletedRequestInfoCleanupService.java#L186-L192
3. Several new files are missing the Apache license header. [`CLAUDE.md`](https://github.com/apache/ozone/blob/047e955d4b23202bad7f9e0b4a6ac9d8a56608c2/CLAUDE.md) requires it on all new files, and `rat.sh` will fail. Affected files include `NotificationCheckpointStrategy.java`, `OMEventListener.java`, `OMEventListenerPluginContext.java`, `LocalFileCheckpointStrategy.java`, `OMEventListenerPluginContextImpl.java`, `OzoneFileCheckpointStrategy.java`, `OMEventListenerNotificationStrategy.java`, `S3EventNotificationBuilder.java`, and `S3EventNotificationStrategy.java`.
https://github.com/apache/ozone/blob/047e955d4b23202bad7f9e0b4a6ac9d8a56608c2/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/eventlistener/NotificationCheckpointStrategy.java#L1-L5
4. `S3EventNotification.java` and `DateTimeJsonSerializer.java` carry Amazon copyright headers (`Copyright 2014-2025 Amazon Technologies, Inc.` / `Copyright (c) 2016. Amazon.com, Inc.`) copied from the AWS SDK 1.x. The ASF RAT check will reject these. The PR comment already notes "We may not need to fork this class" -- if the class is needed, it should be rewritten or the provenance documented under ASF IP policy.
https://github.com/apache/ozone/blob/047e955d4b23202bad7f9e0b4a6ac9d8a56608c2/hadoop-ozone/ozone-manager-plugins/src/main/java/org/apache/hadoop/ozone/om/eventlistener/s3/S3EventNotification.java#L1-L12
🤖 Generated with [Claude Code](https://claude.ai/code)
<sub>- If this code review was useful, please react with 👍. Otherwise, react with 👎.</sub>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-13513. Ozone Event Notification [ozone]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #9012:
URL: https://github.com/apache/ozone/pull/9012#issuecomment-3747087985
This PR has been marked as stale due to 21 days of inactivity. Please comment or remove the stale label to keep it open. Otherwise, it will be automatically closed in 7 days.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-13513. Ozone Event Notification [ozone]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #9012:
URL: https://github.com/apache/ozone/pull/9012#issuecomment-5148550794
This PR has been marked as stale due to 21 days of inactivity. Please comment or remove the stale label to keep it open. Otherwise, it will be automatically closed in 7 days.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-13513. Ozone Event Notification [ozone]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #9012: HDDS-13513. Ozone Event Notification
URL: https://github.com/apache/ozone/pull/9012
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org
Re: [PR] HDDS-13513. Ozone Event Notification [ozone]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #9012:
URL: https://github.com/apache/ozone/pull/9012#issuecomment-4774407054
This PR has been marked as stale due to 21 days of inactivity. Please comment or remove the stale label to keep it open. Otherwise, it will be automatically closed in 7 days.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org