]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Revert "ReplicatedPG: only allow a degraded write if we have at least min_size copies"
authorSamuel Just <sjust@redhat.com>
Mon, 23 Mar 2015 18:16:27 +0000 (11:16 -0700)
committerSamuel Just <sjust@redhat.com>
Mon, 23 Mar 2015 18:16:27 +0000 (11:16 -0700)
This reverts commit 48466f8d7ce2b6762077f3fc686ada5648021517.

src/common/config_opts.h
src/osd/ReplicatedPG.cc
src/osd/ReplicatedPG.h

index fcaf0568efc5648e471092ac47ed721f3bdef613..8e817e140347679a1c00953e46fd3ba4b4dc06e9 100644 (file)
@@ -657,7 +657,6 @@ OPTION(osd_failsafe_full_ratio, OPT_FLOAT, .97) // what % full makes an OSD "ful
 OPTION(osd_failsafe_nearfull_ratio, OPT_FLOAT, .90) // what % full makes an OSD near full (failsafe)
 
 OPTION(osd_pg_object_context_cache_count, OPT_INT, 64)
-OPTION(osd_enable_degraded_writes, OPT_BOOL, true)
 
 // determines whether PGLog::check() compares written out log to stored log
 OPTION(osd_debug_pg_log_writeout, OPT_BOOL, false)
index 614fdf0b6fe20624af903aa6e38115b998c73158..094187a13baf415422e97df7f7504ffbc1e04e19 100644 (file)
@@ -440,36 +440,6 @@ void ReplicatedPG::wait_for_all_missing(OpRequestRef op)
   op->mark_delayed("waiting for all missing");
 }
 
-bool ReplicatedPG::is_degraded_object(const hobject_t &soid, int *healthy_copies)
-{
-  bool degraded = false;
-  assert(healthy_copies);
-  *healthy_copies = 0;
-
-  if (pg_log.get_missing().missing.count(soid)) {
-    degraded = true;
-  } else {
-    *healthy_copies += 1;
-  }
-
-  for (set<pg_shard_t>::iterator i = actingbackfill.begin();
-       i != actingbackfill.end();
-       ++i) {
-    if (*i == get_primary()) continue;
-    pg_shard_t peer = *i;
-    if (peer_missing.count(peer) &&
-        peer_missing[peer].missing.count(soid)) {
-      degraded = true;
-      continue;
-    }
-
-    assert(peer_info.count(peer));
-    if (!peer_info[peer].is_incomplete())
-      *healthy_copies += 1;
-  }
-  return degraded;
-}
-
 bool ReplicatedPG::is_degraded_or_backfilling_object(const hobject_t& soid)
 {
   if (pg_log.get_missing().missing.count(soid))
@@ -1483,13 +1453,10 @@ void ReplicatedPG::do_op(OpRequestRef& op)
    *
    * We also block if our peers do not support DEGRADED_WRITES.
    */
-  int valid_copies = 0;
-  if (write_ordered &&
-      is_degraded_object(head, &valid_copies) &&
-      (valid_copies < pool.info.min_size ||
-       pool.info.ec_pool() ||
-       !cct->_conf->osd_enable_degraded_writes ||
-       !(get_min_peer_features() & CEPH_FEATURE_OSD_DEGRADED_WRITES))) {
+  if ((pool.info.ec_pool() ||
+       !(get_min_peer_features() & CEPH_FEATURE_OSD_DEGRADED_WRITES)) &&
+      write_ordered &&
+      is_degraded_or_backfilling_object(head)) {
     wait_for_degraded_object(head, op);
     return;
   }
index 61477b5acbdd4699f9efa03ade1b2b6aaeb73413..c05aaaac8768a29bbed8ebaa219b9b019003cee7 100644 (file)
@@ -1514,11 +1514,6 @@ public:
   void wait_for_all_missing(OpRequestRef op);
 
   bool is_degraded_or_backfilling_object(const hobject_t& oid);
-
-  /* true if the object is missing on any peer, *healthy_copies will be
-   * set to the number of complete peers not missing the object
-   */
-  bool is_degraded_object(const hobject_t &oid, int *healthy_copies);
   void wait_for_degraded_object(const hobject_t& oid, OpRequestRef op);
 
   bool maybe_await_blocked_snapset(const hobject_t &soid, OpRequestRef op);