]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ReplicatedPG: block writes on degraded objects unless all peers support it 3641/head
authorSamuel Just <sjust@redhat.com>
Tue, 3 Feb 2015 17:11:44 +0000 (09:11 -0800)
committerSamuel Just <sjust@redhat.com>
Wed, 4 Feb 2015 22:59:13 +0000 (14:59 -0800)
Fixes: #10731
Signed-off-by: Samuel Just <sjust@redhat.com>
src/include/ceph_features.h
src/osd/ReplicatedPG.cc

index 2fb51375cfc94d04e641f132e41721dfc41eb3a1..24077e0b51afbd77c7776d2d936c7925fa73022a 100644 (file)
@@ -61,6 +61,8 @@
 #define CEPH_FEATURE_MDS_QUOTA      (1ULL<<47)
 #define CEPH_FEATURE_CRUSH_V4      (1ULL<<48)  /* straw2 buckets */
 #define CEPH_FEATURE_OSD_MIN_SIZE_RECOVERY (1ULL<<49)
+// duplicated since it was introduced at the same time as MIN_SIZE_RECOVERY
+#define CEPH_FEATURE_OSD_DEGRADED_WRITES (1ULL<<49)
 
 #define CEPH_FEATURE_RESERVED2 (1ULL<<61)  /* slow down, we are almost out... */
 #define CEPH_FEATURE_RESERVED  (1ULL<<62)  /* DO NOT USE THIS ... last bit! */
@@ -146,6 +148,7 @@ static inline unsigned long long ceph_sanitize_features(unsigned long long f) {
         CEPH_FEATURE_MDS_QUOTA | \
          CEPH_FEATURE_CRUSH_V4 |            \
          CEPH_FEATURE_OSD_MIN_SIZE_RECOVERY |           \
+         CEPH_FEATURE_OSD_DEGRADED_WRITES |             \
         0ULL)
 
 #define CEPH_FEATURES_SUPPORTED_DEFAULT  CEPH_FEATURES_ALL
index 93f4f72b88d18afd9f73d766a0a7b462dcd3ead3..8fb3d510d579eb0f5c6876d0888ecacf18560584 100644 (file)
@@ -1450,8 +1450,13 @@ void ReplicatedPG::do_op(OpRequestRef& op)
    * We can enable degraded writes on ec pools by blocking such a write
    * to a peer until all previous writes have completed.  For now, we
    * will simply block them.
+   *
+   * We also block if our peers do not support DEGRADED_WRITES.
    */
-  if (pool.info.ec_pool() && write_ordered && is_degraded_object(head)) {
+  if ((pool.info.ec_pool() ||
+       !(get_min_peer_features() & CEPH_FEATURE_OSD_DEGRADED_WRITES)) &&
+      write_ordered &&
+      is_degraded_object(head)) {
     wait_for_degraded_object(head, op);
     return;
   }