Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save 9401adarsh/774727bd6e74083de4826fbf98180680 to your computer and use it in GitHub Desktop.

Select an option

Save 9401adarsh/774727bd6e74083de4826fbf98180680 to your computer and use it in GitHub Desktop.

start vstart using the following command under build/

MON=1 OSD=1 MDS=0 MGR=0 RGW=1 ../src/vstart.sh -n -d --rgw_port 12000

on aws-cli - set aws-creds based on vstart.sh output.

do the following:

i) create a persistent topic

aws --endpoint-url http://localhost:12000 sns create-topic --name=fishtopic   --attributes='{"push-endpoint": "http://localhost:10900", "persistent": "true"}'

radosgw-logfile:

2025-06-21T18:42:54.213+0000 7f31b6ee76c0 20 req 17452387104253860448 0.010000006s sns:pubsub_topic_create Successfully created 3 shards for topic: fishtopic

ii) create a bucket

aws --endpoint-url http://localhost:12000 s3 mb s3://fish

iii) create a notification on fish pointing to fishtopic for objcet creation and deletion.

aws --endpoint-url http://localhost:12000 s3api put-bucket-notification-configuration  --bucket fish \
  --notification-configuration='{"TopicConfigurations": [{"Id": "notif1", "TopicArn": "arn:aws:sns:default::fishtopic", "Events": []}]}'

iv) create and delete an object on fish bucket.

aws --endpoint-url http://localhost:12000 s3 cp myfile s3://fish

aws --endpoint-url http://localhost:12000 s3 rm s3://fish/myfile

Notifications

INFO:root:Starting httpd...

INFO:root:POST request,
Path: /
Headers:
Host: localhost:10900
Accept: */*
Content-Type: application/json
Content-Length: 817



Body:
{"Records":[{"eventVersion":"2.2","eventSource":"ceph:s3","awsRegion":"default","eventTime":"2025-07-10T17:56:33.036308Z","eventName":"ObjectCreated:Put","userIdentity":{"principalId":"testid"},"requestParameters":{"sourceIPAddress":""},"responseElements":{"x-amz-request-id":"2470625f-2b78-4a0b-a017-c6bff0cf4d53.4179.15793381899231844904","x-amz-id-2":"4179-default-default"},"s3":{"s3SchemaVersion":"1.0","configurationId":"notif1","bucket":{"name":"fish","ownerIdentity":{"principalId":"testid"},"arn":"arn:aws:s3:default::fish","id":"2470625f-2b78-4a0b-a017-c6bff0cf4d53.4179.1"},"object":{"key":"myfile","size":1720,"eTag":"b978a5b48b10c4ce46da73835734e417","versionId":"","sequencer":"D1FE6F68ACAC6102","metadata":[],"tags":[]}},"eventId":"1752170193.039955.b978a5b48b10c4ce46da73835734e417","opaqueData":""}]}

127.0.0.1 - - [10/Jul/2025 17:56:33] "POST / HTTP/1.1" 200 -
INFO:root:POST request,
Path: /
Headers:
Host: localhost:10900
Accept: */*
Content-Type: application/json
Content-Length: 819



Body:
{"Records":[{"eventVersion":"2.2","eventSource":"ceph:s3","awsRegion":"default","eventTime":"2025-07-10T17:58:00.925198Z","eventName":"ObjectRemoved:Delete","userIdentity":{"principalId":"testid"},"requestParameters":{"sourceIPAddress":""},"responseElements":{"x-amz-request-id":"2470625f-2b78-4a0b-a017-c6bff0cf4d53.4179.7484942672191574226","x-amz-id-2":"4179-default-default"},"s3":{"s3SchemaVersion":"1.0","configurationId":"notif1","bucket":{"name":"fish","ownerIdentity":{"principalId":"testid"},"arn":"arn:aws:s3:default::fish","id":"2470625f-2b78-4a0b-a017-c6bff0cf4d53.4179.1"},"object":{"key":"myfile","size":1720,"eTag":"b978a5b48b10c4ce46da73835734e417","versionId":"","sequencer":"28FF6F6818802537","metadata":[],"tags":[]}},"eventId":"1752170280.925204.b978a5b48b10c4ce46da73835734e417","opaqueData":""}]}

v) set fishtopic to become non-persistent

aws sns --endpoint-url "http://localhost:12000" set-topic-attributes --topic-arn "arn:aws:sns:default::fishtopic" --attribute-name persistent --attribute-value false

radosgw-logfile:

2025-06-21T18:44:53.339+0000 7f31a06ba6c0 20 req 3502419843100170800 0.007000004s sns:pubsub_topic_set Successfully removed 3 shards for topic: fishtopic

vi) re-create fishtopic to become persistent

aws --endpoint-url http://localhost:12000 sns create-topic --name=fishtopic   -
-attributes='{"push-endpoint": "http://localhost:10900", "persistent": "true"}'

radosgw-logfile

2025-06-21T18:48:07.055+0000 7f31836806c0 20 req 15103981489690498022 0.007000004s sns:pubsub_topic_create Successfully created 3 shards for topic: fishtopic

Stop vstart. Switch to main and build again. Following build start vstart using MON=1 OSD=1 MDS=0 MGR=0 RGW=1 ../src/vstart.sh -d --rgw_port 12000

viii) set fishtopic to become non-persistent

aws sns --endpoint-url "http://localhost:12000" set-topic-attributes --topic-arn "arn:aws:sns:default::fishtopic" --attribute-name persistent --attribute-value false
An error occurred (UnknownError) when calling the SetTopicAttributes operation (reached max retries: 2): None

ix) create and delete an object on fish bucket.

aws --endpoint-url http://localhost:12000 s3 cp myfile s3://fish

aws --endpoint-url http://localhost:12000 s3 rm s3://fish/myfile

radosgw-log: ERROR: failed to decode bucket topics for bucket: fish aws-cli: upload failed: ./myfile to s3://fish/myfile argument of type 'NoneType' is not iterable

x) delete fishtopic

aws sns --endpoint-url "http://localhost:12000" delete-topic --topic-arn "arn:aws:sns:default::fishtopic"
An error occurred (UnknownError) when calling the DeleteTopic operation (reached max retries: 2): None

Stop cluster. Switch to feature and build again. Following build start vstart using MON=1 OSD=1 MDS=0 MGR=0 RGW=1 ../src/vstart.sh -d --rgw_port 12000

xi) delete fishtopic

aws sns --endpoint-url "http://localhost:12000" delete-topic --topic-arn "arn:aws:sns:default::fishtopic"

radosgw-logfile

2025-06-21T18:49:36.013+0000 7f317065a6c0 20 req 16032777696987863341 0.007000004s sns:pubsub_topic_delete Successfully removed3 shards for topic: fishtopic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment