From: Samuel Just Date: Tue, 3 Feb 2015 17:11:44 +0000 (-0800) Subject: ReplicatedPG: block writes on degraded objects unless all peers support it X-Git-Tag: v0.93~70^2~4^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2f49de51103d842e37499b6d464208edaed77e6b;p=ceph.git ReplicatedPG: block writes on degraded objects unless all peers support it Fixes: #10731 Signed-off-by: Samuel Just --- diff --git a/src/include/ceph_features.h b/src/include/ceph_features.h index 2fb51375cfc9..24077e0b51af 100644 --- a/src/include/ceph_features.h +++ b/src/include/ceph_features.h @@ -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 diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 93f4f72b88d1..8fb3d510d579 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -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; }