]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/pubsub: CreateTopic requires notification_v2 for accounts
authorCasey Bodley <cbodley@redhat.com>
Thu, 14 Mar 2024 16:04:08 +0000 (12:04 -0400)
committerCasey Bodley <cbodley@redhat.com>
Fri, 12 Apr 2024 19:34:30 +0000 (15:34 -0400)
the account's topic index is only updated by writes/deletes to v2 topic
metadata

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 7d5b826a4acfbc1df6400b8df990ebfed2c64666)

src/rgw/rgw_rest_pubsub.cc

index d4204d686e247a604a333737f68a39b64b83f5b8..e268a4fadba4ef0d7d4cdec6e56817d65742a9f2 100644 (file)
@@ -293,7 +293,13 @@ class RGWPSCreateTopicOp : public RGWOp {
     }
 
     if (s->auth.identity->get_account()) {
-      // account users don't consult the existing owner/policy
+      // account users don't consult the existing owner/policy, but they do
+      // require the notification_v2 format to index the topic metadata
+      if (!rgw::all_zonegroups_support(*s->penv.site, rgw::zone_features::notification_v2)) {
+        s->err.message = "The 'notification_v2' zone feature must be enabled "
+            "to create topics in an account";
+        return -EINVAL;
+      }
       return 0;
     }