jojochuang commented on code in PR #8871: URL: https://github.com/apache/ozone/pull/8871#discussion_r2237286704
########## hadoop-hdds/docs/content/design/event-notifications.md: ########## @@ -0,0 +1,193 @@ +--- +title: Event notification support in Ozone +summary: Event notifications for all bucket/event types in ozone +date: 2025-06-28 +jira: HDDS-13513 +status: design +author: Donal Magennis, Colm Dougan +--- +<!-- + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. See accompanying LICENSE file. +--> + +# Abstract + +Implement an event notification system for Apache Ozone, providing the ability for users to consume events occuring on the Ozone filesystem. +This is similar to https://issues.apache.org/jira/browse/HDDS-5984 but aims to encapsulate all events and not solely S3 buckets. +This document proposes a potential solution and discusses some of the challenges/open questions. + +# Introduction + +Apache Ozone does not currently provide the ability to consume filesystem events, similar to how HDFS does with Inotify or S3 with bucket notifications. +These events are an integral part of integration with external systems to support real-time, scalable, and programmatic monitoring of changes in the data or metadata stored in Ozone. +These external systems can use notifications of objects created/deleted to trigger data processing workflows, replication and monitoring alerts. + +# Goals + +Provide support for all events across the Ozone filesystem for FSO and non FSO buckets, including renames and changes to acls. +Not impact with performance of client requests. +Guarantee at-least-once delivery. + +# Non-Goals + +Filtering of events or paths/buckets +Persistent storage of notification messages +Asynchronous delivery + +# Supported OMRequests + +OMDirectoryCreateRequest +OMKeyCommitRequest +OMKeyDeleteRequest +OMKeyRenameRequest +OMKeyAddAclRequest +OMKeyRemoveAclRequest +OMKeySetAclRequest +OMKeySetTimesRequest + +# Design + +## Overview + +Introduce a new OzoneManager node in the ratis ring in LISTENER mode. +The node will be defined up-front in ozone-site.xml. +This node will maintain metadata similar to the other OM nodes however it will generate notifications for events after they have been successfully commited. +This node will not be able to become a leader, so the notification process will not impact client requests. + + + +#### Component + +Implementation of this feature requires changes to the OzoneManager: + - Implement an agnostic notification interface + - Add support for a LISTENER node + - Add a hook in the OMRequest exection flow to generate notifications + +#### Component + +Introduces a new field on OMAdminProtocol.proto to identify the notify node: + +```protobuf +message OMNodeInfo { +required string nodeID = 1; +required string hostAddress = 2; +required uint32 rpcPort = 3; +required uint32 ratisPort = 4; +optional NodeState nodeState = 5 [default=ACTIVE]; +optional bool isNotifyNode = 6 [default=false]; +} +``` + +## Performance + +While this is a synchronous only approach any latency between notification target and OM should not impact the performance of client requests as the notification does not run on the leader. + +## Configuration + +This is the configuration to enable event notification on node on1. + +```xml +<property> + <name>ozone.event.notification.node</name> + <value>on1</value> +</property> +``` +Example configuration to provide a kafka instance: +```xml + +<configration> Review Comment: Optionally, support AWS's PutBucketNotificationConfiguration and GetBucketNotificationConfiguration -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
