]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
radosgw-admin: 'sync status' shows enabled/disabled zonegroup features
authorCasey Bodley <cbodley@redhat.com>
Wed, 3 Mar 2021 21:55:23 +0000 (16:55 -0500)
committerCasey Bodley <cbodley@redhat.com>
Fri, 27 May 2022 19:47:32 +0000 (15:47 -0400)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_admin.cc
src/rgw/rgw_sal_rados.h

index e5438a0985b6417a8e3aaf9f322e9097f726e2f9..65c8f4e0b39f6d27af1111c267c426a85b2f5917 100644 (file)
@@ -2415,6 +2415,16 @@ static void tab_dump(const string& header, int width, const list<string>& entrie
   }
 }
 
+// return features that are supported but not enabled
+static auto get_disabled_features(const rgw::zone_features::set& enabled) {
+  auto features = rgw::zone_features::set{rgw::zone_features::supported.begin(),
+                                          rgw::zone_features::supported.end()};
+  for (const auto& feature : enabled) {
+    features.erase(feature);
+  }
+  return features;
+}
+
 
 static void sync_status(Formatter *formatter)
 {
@@ -2427,6 +2437,14 @@ static void sync_status(Formatter *formatter)
   cout << std::setw(width) << "zonegroup" << std::setw(1) << " " << zonegroup.get_id() << " (" << zonegroup.get_name() << ")" << std::endl;
   cout << std::setw(width) << "zone" << std::setw(1) << " " << zone->get_id() << " (" << zone->get_name() << ")" << std::endl;
 
+  const auto& rzg =
+    static_cast<const rgw::sal::RadosZoneGroup&>(zonegroup).get_group();
+
+  cout << std::setw(width) << "zonegroup features enabled: " << rzg.enabled_features << std::endl;
+  if (auto d = get_disabled_features(rzg.enabled_features); !d.empty()) {
+    cout << std::setw(width) << "                   disabled: " << d << std::endl;
+  }
+
   list<string> md_status;
 
   if (store->is_meta_master()) {
index 1e92249cea7ea49c1547e3e33ebdc36eba524d0f..2640fd5cbfe28fd720228092205b194434986a3c 100644 (file)
@@ -85,7 +85,7 @@ public:
     return group.zones.size();
   }
   virtual int get_placement_tier(const rgw_placement_rule& rule, std::unique_ptr<PlacementTier>* tier);
-  const RGWZoneGroup& get_group() { return group; }
+  const RGWZoneGroup& get_group() const { return group; }
 };
 
 class RadosZone : public Zone {