]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
objecter: waive OSDMAP_FULL check for MDS 1504/head
authorJohn Spray <john.spray@inktank.com>
Wed, 19 Mar 2014 11:21:21 +0000 (11:21 +0000)
committerJohn Spray <john.spray@inktank.com>
Wed, 19 Mar 2014 16:22:37 +0000 (16:22 +0000)
The MDS expects to be able to perform writes to OSDs even
if the full ratio has been reached, in order to journal
file deletions to free space.

Fixes: #7780
Signed-off-by: John Spray <john.spray@inktank.com>
src/osdc/Objecter.cc
src/osdc/Objecter.h

index a2954662605cfb5a0f2b723d4aae3c0ae3ee09c5..08d16e1406456ddeb7d2e4bd6cea4a6d7e7aeb9c 100644 (file)
@@ -567,7 +567,7 @@ void Objecter::handle_osd_map(MOSDMap *m)
   }
 
   bool was_pauserd = osdmap->test_flag(CEPH_OSDMAP_PAUSERD);
-  bool was_full = osdmap->test_flag(CEPH_OSDMAP_FULL);
+  bool was_full = osdmap_full_flag();
   bool was_pausewr = osdmap->test_flag(CEPH_OSDMAP_PAUSEWR) || was_full;
 
   list<LingerOp*> need_resend_linger;
@@ -618,7 +618,7 @@ void Objecter::handle_osd_map(MOSDMap *m)
        }
        logger->set(l_osdc_map_epoch, osdmap->get_epoch());
 
-       was_full = was_full || osdmap->test_flag(CEPH_OSDMAP_FULL);
+       was_full = was_full || osdmap_full_flag();
        scan_requests(skipped_map, was_full, need_resend, need_resend_linger,
                      need_resend_command);
 
@@ -655,7 +655,7 @@ void Objecter::handle_osd_map(MOSDMap *m)
   }
 
   bool pauserd = osdmap->test_flag(CEPH_OSDMAP_PAUSERD);
-  bool pausewr = osdmap->test_flag(CEPH_OSDMAP_PAUSEWR) || osdmap->test_flag(CEPH_OSDMAP_FULL);
+  bool pausewr = osdmap->test_flag(CEPH_OSDMAP_PAUSEWR) || osdmap_full_flag();
 
   // was/is paused?
   if (was_pauserd || was_pausewr || pauserd || pausewr)
@@ -1021,7 +1021,7 @@ void Objecter::_get_latest_version(epoch_t oldest, epoch_t newest, Context *fin)
 void Objecter::maybe_request_map()
 {
   int flag = 0;
-  if (osdmap->test_flag(CEPH_OSDMAP_FULL)) {
+  if (osdmap_full_flag()) {
     ldout(cct, 10) << "maybe_request_map subscribing (continuous) to next osd map (FULL flag is set)" << dendl;
   } else {
     ldout(cct, 10) << "maybe_request_map subscribing (onetime) to next osd map" << dendl;
@@ -1328,8 +1328,7 @@ tid_t Objecter::_op_submit(Op *op)
     ldout(cct, 10) << " paused read " << op << " tid " << last_tid << dendl;
     op->paused = true;
     maybe_request_map();
-  } else if ((op->flags & CEPH_OSD_FLAG_WRITE) &&
-            osdmap->test_flag(CEPH_OSDMAP_FULL)) {
+  } else if ((op->flags & CEPH_OSD_FLAG_WRITE) && osdmap_full_flag()) {
     ldout(cct, 0) << " FULL, paused modify " << op << " tid " << last_tid << dendl;
     op->paused = true;
     maybe_request_map();
@@ -1395,12 +1394,24 @@ bool Objecter::is_pg_changed(
 bool Objecter::op_should_be_paused(Op *op)
 {
   bool pauserd = osdmap->test_flag(CEPH_OSDMAP_PAUSERD);
-  bool pausewr = osdmap->test_flag(CEPH_OSDMAP_PAUSEWR) || osdmap->test_flag(CEPH_OSDMAP_FULL);
+  bool pausewr = osdmap->test_flag(CEPH_OSDMAP_PAUSEWR) || osdmap_full_flag();
 
   return (op->flags & CEPH_OSD_FLAG_READ && pauserd) ||
          (op->flags & CEPH_OSD_FLAG_WRITE && pausewr);
 }
 
+
+/**
+ * Wrapper around osdmap->test_flag for special handling of the FULL flag.
+ */
+bool Objecter::osdmap_full_flag() const
+{
+  // Ignore the FULL flag if we are working on behalf of an MDS, in order to permit
+  // MDS journal writes for file deletions.
+  return osdmap->test_flag(CEPH_OSDMAP_FULL) && (messenger->get_myname().type() != entity_name_t::TYPE_MDS);
+}
+
+
 int64_t Objecter::get_object_hash_position(int64_t pool, const string& key,
                                           const string& ns)
 {
index 2311f55ce3676f82313811d04f54239ada4e88f5..df5b5d77e03a3f03baa7f2d1fd807208f6c2efa7 100644 (file)
@@ -1463,6 +1463,7 @@ public:
     RECALC_OP_TARGET_OSD_DNE,
     RECALC_OP_TARGET_OSD_DOWN,
   };
+  bool osdmap_full_flag() const;
   bool op_should_be_paused(Op *op);
   int recalc_op_target(Op *op);
   bool recalc_linger_op_target(LingerOp *op);