]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
objecter: kill inc_locks.
authorSage Weil <sage@newdream.net>
Wed, 20 May 2009 18:48:32 +0000 (11:48 -0700)
committerSage Weil <sage@newdream.net>
Wed, 20 May 2009 18:48:32 +0000 (11:48 -0700)
These aren't needed or used since there is a generic blacklist mechanism
in the osdmap (that is simpler and more robust).

src/include/ceph_fs.h
src/include/rados.h
src/mds/MDS.cc
src/mds/MDSMap.h
src/messages/MOSDOp.h
src/osdc/Journaler.cc
src/osdc/Objecter.cc
src/osdc/Objecter.h

index 6521cd47efabe8b67997ab9681962eec72550a3a..5de2c309cacbbe5635089cbee772478472ae3c02 100644 (file)
@@ -26,7 +26,7 @@
 #define CEPH_OSD_PROTOCOL     5 /* cluster internal */
 #define CEPH_MDS_PROTOCOL     9 /* cluster internal */
 #define CEPH_MON_PROTOCOL     4 /* cluster internal */
-#define CEPH_OSDC_PROTOCOL   10 /* public/client */
+#define CEPH_OSDC_PROTOCOL   11 /* public/client */
 #define CEPH_MDSC_PROTOCOL   20 /* public/client */
 #define CEPH_MONC_PROTOCOL   12 /* public/client */
 
index c3b57c0a5dbc5e661e2c0c202d65caf3a41d463e..ef75e48b0570bb61936f613beab52f40448b4020 100644 (file)
@@ -313,7 +313,6 @@ enum {
        CEPH_OSD_FLAG_ONNVRAM = 2,      /* want (or is) "onnvram" ack */
        CEPH_OSD_FLAG_ONDISK = 4,       /* want (or is) "ondisk" ack */
        CEPH_OSD_FLAG_RETRY = 8,        /* resend attempt */
-       CEPH_OSD_FLAG_INCLOCK_FAIL = 16, /* fail on inclock collision */
        CEPH_OSD_FLAG_MODIFY = 32,      /* op is/was a mutation */
        CEPH_OSD_FLAG_ORDERSNAP = 64,   /* EOLDSNAP if snapc is out of order */
        CEPH_OSD_FLAG_PEERSTAT = 128,   /* msg includes osd_peer_stat */
@@ -354,7 +353,6 @@ struct ceph_osd_request_head {
        __le32                    osdmap_epoch;
 
        __le32                    flags;
-       __le32                    inc_lock;
 
        struct ceph_timespec      mtime;
        struct ceph_eversion      reassert_version;
index 9f4df4c64663ca14ffb7b824f6fc7b80bb13fd22..6542cf3fd113004a2bd15f805d44f83c965d9353 100644 (file)
@@ -614,8 +614,6 @@ void MDS::handle_mds_map(MMDSMap *m)
   // tell objecter my incarnation
   if (objecter->get_client_incarnation() != incarnation)
     objecter->set_client_incarnation(incarnation);
-  // and inc_lock
-  objecter->set_inc_lock(mdsmap->get_last_failure());
 
   // for debug
   if (g_conf.mds_dump_cache_on_map)
index c7001c200c8c9092bb2eaa776ad6bf6565be4199..e8d8c7bf6a3d00a04f3483755da064a093116b69 100644 (file)
@@ -122,7 +122,7 @@ protected:
   // base map
   epoch_t epoch;
   epoch_t client_epoch;  // incremented only when change is significant to client.
-  epoch_t last_failure;  // epoch of last failure.  for inclocks
+  epoch_t last_failure;  // epoch of last failure
   utime_t created, modified;
 
   int32_t tableserver;   // which MDS has anchortable, snaptable
index dcfcd50638ea089b58964cdeabc5f23e443f54f5..186bdcbf52161481190b45e39e37b603474e01d8 100644 (file)
@@ -27,8 +27,6 @@
  *
  */
 
-#define EINCLOCKED 100
-
 class MOSDOp : public Message {
 private:
   ceph_osd_request_head head;
@@ -64,8 +62,6 @@ public:
   
   bool is_modify() { return head.flags & CEPH_OSD_FLAG_MODIFY; }
 
-  unsigned get_inc_lock() const { return head.inc_lock; }
-
   void set_peer_stat(const osd_peer_stat_t& stat) {
     peer_stat = stat;
     head.flags = (head.flags | CEPH_OSD_FLAG_PEERSTAT);
@@ -94,7 +90,6 @@ public:
   }
   MOSDOp() {}
 
-  void set_inc_lock(__u32 l) { head.inc_lock = l; }
   void set_layout(const ceph_object_layout& l) { head.layout = l; }
   void set_version(eversion_t v) { head.reassert_version = v; }
   void set_mtime(utime_t mt) { head.mtime = mt; }
index 87dc2ddc291c3988b649f04c2f6eaca52e342aa2..c8fb0ab57fa4ea63e397f5e16ffe324b03e033c5 100644 (file)
@@ -146,7 +146,7 @@ void Journaler::_finish_read_head(int r, bufferlist& bl)
   state = STATE_PROBING;
   C_ProbeEnd *fin = new C_ProbeEnd(this);
   filer.probe(ino, &layout, CEPH_NOSNAP,
-             h.write_pos, (__u64 *)&fin->end, 0, true, CEPH_OSD_FLAG_INCLOCK_FAIL, fin);
+             h.write_pos, (__u64 *)&fin->end, 0, true, 0, fin);
 }
 
 void Journaler::_finish_probe_end(int r, __s64 end)
@@ -407,7 +407,7 @@ void Journaler::_do_flush(unsigned amount)
 
   filer.write(ino, &layout, snapc,
              flush_pos, len, write_bl, g_clock.now(),
-             CEPH_OSD_FLAG_INCLOCK_FAIL,
+             0,
              onack, onsafe);
 
   flush_pos += len;
@@ -604,7 +604,7 @@ void Journaler::_issue_read(__s64 len)
           << dendl;
   
   filer.read(ino, &layout, CEPH_NOSNAP,
-            requested_pos, len, &reading_buf, CEPH_OSD_FLAG_INCLOCK_FAIL,
+            requested_pos, len, &reading_buf, 0,
             new C_Read(this));
   requested_pos += len;
 }
@@ -793,7 +793,7 @@ void Journaler::trim()
   
   SnapContext snapc;
   filer.remove(ino, &layout, snapc,
-              trimming_pos, trim_to-trimming_pos, g_clock.now(), CEPH_OSD_FLAG_INCLOCK_FAIL
+              trimming_pos, trim_to-trimming_pos, g_clock.now(), 0
               NULL, new C_Trim(this, trim_to));
   trimming_pos = trim_to;  
 }
index f6286fc81411aa1dac770be82a0ca38a967b323b..7a4dcb48431dafd0f4b22cf3620bbaa6c91e8144 100644 (file)
@@ -394,10 +394,6 @@ tid_t Objecter::read_submit(ReadOp *rd)
     m->set_snapid(rd->snap);
     m->ops = rd->ops;
     m->set_data(rd->bl);
-    if (inc_lock > 0) {
-      rd->inc_lock = inc_lock;
-      m->set_inc_lock(inc_lock);
-    }
     m->set_retry_attempt(rd->attempts++);
     
     int who = pg.acker();
@@ -436,23 +432,9 @@ void Objecter::handle_osd_read_reply(MOSDOpReply *m)
   pg.active_tids.erase(tid);
   if (pg.active_tids.empty()) close_pg( m->get_pg() );
   
-  // fail?
-  if (m->get_result() == -EINCLOCKED &&
-      rd->flags & CEPH_OSD_FLAG_INCLOCK_FAIL) {
-    dout(7) << " got -EINCLOCKED, failing" << dendl;
-    if (rd->onfinish) {
-      rd->onfinish->finish(-EINCLOCKED);
-      delete rd->onfinish;
-    }
-    delete rd;
-    delete m;
-    return;
-  }
-
   // success?
-  if (m->get_result() == -EAGAIN ||
-      m->get_result() == -EINCLOCKED) {
-    dout(7) << " got -EAGAIN or -EINCLOCKED, resubmitting" << dendl;
+  if (m->get_result() == -EAGAIN) {
+    dout(7) << " got -EAGAIN resubmitting" << dendl;
     read_submit(rd);
     delete m;
     return;
@@ -529,10 +511,6 @@ tid_t Objecter::modify_submit(ModifyOp *wr)
     m->set_mtime(wr->mtime);
     m->set_snap_seq(wr->snapc.seq);
     m->get_snaps() = wr->snapc.snaps;
-    if (inc_lock > 0) {
-      wr->inc_lock = inc_lock;
-      m->set_inc_lock(inc_lock);
-    }
     m->set_retry_attempt(wr->attempts++);
     
     if (wr->version != eversion_t())
@@ -583,25 +561,9 @@ void Objecter::handle_osd_modify_reply(MOSDOpReply *m)
   }
   
   int rc = 0;
-  if (m->get_result() == -EINCLOCKED && wr->flags & CEPH_OSD_FLAG_INCLOCK_FAIL) {
-    dout(7) << " got -EINCLOCKED, failing" << dendl;
-    rc = -EINCLOCKED;
-    if (wr->onack) {
-      onack = wr->onack;
-      wr->onack = 0;
-      num_unacked--;
-    }
-    if (wr->oncommit) {
-      oncommit = wr->oncommit;
-      wr->oncommit = 0;
-      num_uncommitted--;
-    }
-    goto done;
-  }
 
-  if (m->get_result() == -EAGAIN ||
-      m->get_result() == -EINCLOCKED) {
-    dout(7) << " got -EAGAIN or -EINCLOCKED, resubmitting" << dendl;
+  if (m->get_result() == -EAGAIN) {
+    dout(7) << " got -EAGAIN, resubmitting" << dendl;
     if (wr->onack) num_unacked--;
     if (wr->oncommit) num_uncommitted--;
     modify_submit(wr);
@@ -626,9 +588,6 @@ void Objecter::handle_osd_modify_reply(MOSDOpReply *m)
     num_uncommitted--;
   }
 
-  // done?
- done:
-
   // done with this tid?
   if (!wr->onack && !wr->oncommit) {
     assert(pg.active_tids.count(tid));
index 6cc4bb04604d5469a37c2e47f037be546e5861f3..425f40bf85eb573bbb4ee46c670e9c8196e9c358 100644 (file)
@@ -162,7 +162,6 @@ class Objecter {
  private:
   tid_t last_tid;
   int client_inc;
-  int inc_lock;       // optional
   int num_unacked;
   int num_uncommitted;
 
@@ -199,14 +198,13 @@ class Objecter {
 
     tid_t tid;
     int attempts;
-    int inc_lock;
 
     bool paused;
 
     ReadOp(object_t o, ceph_object_layout& ol, vector<ceph_osd_op>& op, snapid_t s, int f, Context *of) :
       oid(o), layout(ol), snap(s),
       pbl(0), flags(f), onfinish(of), 
-      tid(0), attempts(0), inc_lock(-1),
+      tid(0), attempts(0),
       paused(false) {
       ops.swap(op);
     }
@@ -225,7 +223,6 @@ class Objecter {
 
     tid_t tid;
     int attempts;
-    int inc_lock;
     eversion_t version;
 
     bool paused;
@@ -233,7 +230,7 @@ class Objecter {
     ModifyOp(object_t o, ceph_object_layout& l, vector<ceph_osd_op>& op, utime_t mt,
             const SnapContext& sc, int f, Context *ac, Context *co) :
       oid(o), layout(l), snapc(sc), mtime(mt), flags(f), onack(ac), oncommit(co), 
-      tid(0), attempts(0), inc_lock(-1),
+      tid(0), attempts(0),
       paused(false) {
       ops.swap(op);
     }
@@ -310,7 +307,7 @@ class Objecter {
  public:
   Objecter(Messenger *m, MonMap *mm, OSDMap *om, Mutex& l) : 
     messenger(m), monmap(mm), osdmap(om), 
-    last_tid(0), client_inc(-1), inc_lock(0),
+    last_tid(0), client_inc(-1),
     num_unacked(0), num_uncommitted(0),
     last_epoch_requested(0),
     client_lock(l), timer(l)
@@ -340,9 +337,6 @@ class Objecter {
   int get_client_incarnation() const { return client_inc; }
   void set_client_incarnation(int inc) { client_inc = inc; }
 
-  //int get_inc_lock() const { return inc_lock; }
-  void set_inc_lock(int l) { inc_lock = l; }
-    
   // low-level
   tid_t read_submit(ReadOp *rd);
   tid_t modify_submit(ModifyOp *wr);