-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bucket Notifications #8337
Bucket Notifications #8337
Conversation
180b6fc
to
e3888e6
Compare
7c2633e
to
e48b9c5
Compare
e48b9c5
to
c84729b
Compare
d09a342
to
47edd81
Compare
a090200
to
627dd18
Compare
@@ -76,6 +79,11 @@ async function put_object(req, res) { | |||
}; | |||
} | |||
res.setHeader('ETag', `"${reply.etag}"`); | |||
|
|||
if (reply.seq) { | |||
res.seq = reply.seq; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like seq is only returned in namespace_nb flows. This will not work for other namespaces
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right.
As we've discussed we can add a sequence to standalone, at the cost of adding a synchronized step to all s3 ops, so it's preferred for now to see if this is actually needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But what about other namespaces (S3, Azure, FS) that are not in standalone?
e81d8dd
to
cdcf436
Compare
fe4db12
to
cb3a0c5
Compare
af9d0f6
to
eb831a2
Compare
Signed-off-by: Amit Prinz Setter <[email protected]>
Signed-off-by: Amit Prinz Setter <[email protected]>
Signed-off-by: Amit Prinz Setter <[email protected]>
Signed-off-by: Amit Prinz Setter <[email protected]>
Signed-off-by: Amit Prinz Setter <[email protected]>
…amespace for easier parsing) Signed-off-by: Amit Prinz Setter <[email protected]>
1. Introduce OP_TO_EVENT, remove req.s3event 2. sequencer fallback to timestamp for non-noobaa nss Signed-off-by: Amit Prinz Setter <[email protected]>
eb831a2
to
6c40606
Compare
Explain the changes
Add S3 notification support.
AWS info https://docs.aws.amazon.com/AmazonS3/latest/userguide/EventNotifications.html
Limitations:
-No LifeCycle events.
Issues: Fixed #xxx / Gap #xxx
Testing Instructions:
-Run local Kafka with
docker run -p 9092:9092 apache/kafka-native:3.8.0
Connect cli consumer to Kafka:
./kafka/kafka_2.13-3.8.0/bin/kafka-console-consumer.sh --topic --from-beginning --bootstrap-server localhost:9092
Alternatively, for nsfs, you can use nsfs_manage to add "notifications" field to bucket.
Example of an nsfs bucket with notifications:
aprinzse:noobaa-core$ cat bucket_notif_event.json
{
"name": "notif-both",
"owner": "amit1",
"path": "/home/aprinzse/work/standalone/storage_root/notif_both",
"notifications": [
{"Id": "notif_event_kafka", "Events": ["s3:ObjectCreated:"], "Connect": "/home/aprinzse/work/standalone/connect.kv"},
{"Id": "notif_event_http", "Events": ["s3:ObjectCreated:"], "Connect": "/home/aprinzse/work/standalone/connect_http.kv"}
]
}
Where connect.kv for Kafka looks like-
aprinzse:noobaa-core$ cat /home/aprinzse/work/standalone/connect.kv
metadata.broker.list=localhost:9092
notification_protocol=kafka
topic=
name=kafka_notif
And for http:
aprinzse:noobaa-core$ cat /home/aprinzse/work/standalone/connect_http.kv
http_object={"host": "localhost", "port": 9999, "timeout": 100}
notification_protocol=http
name=http_notif
-Run NSFS server with NOTIFICATION_LOG_DIR env, eg
NOTIFICATION_LOG_DIR=/home/aprinzse/work/standalone/notifications_log node src/cmd/nsfs
-Kicking-off notification file processor to send notification with "notification" operation (also need the NOTIFICATION_LOG_DIR env param):
NOTIFICATION_LOG_DIR=/home/aprinzse/work/standalone/notifications_log node src/cmd/manage_nsfs notification