]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: propagate base pool application_metadata to tiers 40119/head
authorSage Weil <sage@newdream.net>
Sat, 13 Mar 2021 16:34:43 +0000 (11:34 -0500)
committerSage Weil <sage@newdream.net>
Sat, 13 Mar 2021 16:51:39 +0000 (10:51 -0600)
If there is application metadata on the base pool, it should be mirrored
to any other tiers in the set.  This aligns with the fact that the
'ceph osd pool application ...' commands refuse to operate on a non-base
pool.

This fixes problems with accessing tiers (e.g., cache tiers) when the
cephx cap is written in terms of application metadata.

Fixes: https://tracker.ceph.com/issues/49788
Signed-off-by: Sage Weil <sage@newdream.net>
(cherry picked from commit 8bcb281a7d91e6daa842aed4ffb416d764dc6bf1)

qa/workunits/cephtool/test.sh
src/mon/OSDMonitor.cc
src/osd/OSDMap.cc
src/osd/OSDMap.h

index 3c1eb36cb21f3c3e840f90a6dbb7e72434bf809b..4a559c07220dfa807ae399b6055df47f3a4f0a10 100755 (executable)
@@ -345,6 +345,11 @@ function test_tiering_1()
   ceph osd tier add slow cache
   ceph osd tier add slow cache2
   expect_false ceph osd tier add slow2 cache
+  # application metadata should propagate to the tiers
+  ceph osd pool ls detail -f json | jq '.[] | select(.pool_name == "slow") | .application_metadata["rados"]' | grep '{}'
+  ceph osd pool ls detail -f json | jq '.[] | select(.pool_name == "slow2") | .application_metadata["rados"]' | grep '{}'
+  ceph osd pool ls detail -f json | jq '.[] | select(.pool_name == "cache") | .application_metadata["rados"]' | grep '{}'
+  ceph osd pool ls detail -f json | jq '.[] | select(.pool_name == "cache2") | .application_metadata["rados"]' | grep '{}'
   # forward and proxy are removed/deprecated
   expect_false ceph osd tier cache-mode cache forward
   expect_false ceph osd tier cache-mode cache forward --yes-i-really-mean-it
index 26e7aee0c31b80d38f2d735584be9f49d2fc6dee..c4707101b69fa3a4ead156a8cff9d18da82f0875 100644 (file)
@@ -1567,7 +1567,7 @@ void OSDMonitor::encode_pending(MonitorDBStore::TransactionRef t)
   // finalize up pending_inc
   pending_inc.modified = ceph_clock_now();
 
-  int r = pending_inc.propagate_snaps_to_tiers(cct, osdmap);
+  int r = pending_inc.propagate_base_properties_to_tiers(cct, osdmap);
   ceph_assert(r == 0);
 
   if (mapping_job) {
index 3dfce67d5cf1e0a70dba08ca5fb5d81f8daf5378..4e0fab932af12fa7c875811b8de9c365d3c4998a 100644 (file)
@@ -238,8 +238,8 @@ int OSDMap::Incremental::identify_osd(uuid_d u) const
   return -1;
 }
 
-int OSDMap::Incremental::propagate_snaps_to_tiers(CephContext *cct,
-                                                 const OSDMap& osdmap)
+int OSDMap::Incremental::propagate_base_properties_to_tiers(CephContext *cct,
+                                                           const OSDMap& osdmap)
 {
   ceph_assert(epoch == osdmap.get_epoch() + 1);
 
@@ -279,6 +279,8 @@ int OSDMap::Incremental::propagate_snaps_to_tiers(CephContext *cct,
        if (new_rem_it != new_removed_snaps.end()) {
          new_removed_snaps[tier_pool] = new_rem_it->second;
        }
+
+       tier->application_metadata = base.application_metadata;
       }
     }
   }
index e0f496138c445d8eac854860c03eb8602ff756e2..711badddec066f7900d20606d92d06dbc67d7c79 100644 (file)
@@ -465,8 +465,8 @@ public:
       return new_erasure_code_profiles;
     }
 
-    /// propagate update pools' snap metadata to any of their tiers
-    int propagate_snaps_to_tiers(CephContext *cct, const OSDMap &base);
+    /// propagate update pools' (snap and other) metadata to any of their tiers
+    int propagate_base_properties_to_tiers(CephContext *cct, const OSDMap &base);
 
     /// filter out osds with any pending state changing
     size_t get_pending_state_osds(std::vector<int> *osds) {