]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge commit 'origin/unstable' into auth
authorYehuda Sadeh <yehuda@hq.newdream.net>
Mon, 21 Sep 2009 23:35:01 +0000 (16:35 -0700)
committerYehuda Sadeh <yehuda@hq.newdream.net>
Mon, 21 Sep 2009 23:35:01 +0000 (16:35 -0700)
Conflicts:

src/mon/MonClient.cc
src/mon/MonClient.h

14 files changed:
1  2 
src/Makefile.am
src/ceph.cc
src/client/Client.cc
src/kernel/Makefile
src/kernel/super.c
src/kernel/super.h
src/librados.cc
src/mon/ClientMonitor.cc
src/mon/MonClient.cc
src/mon/MonClient.h
src/mon/Monitor.cc
src/mon/Monitor.h
src/msg/Message.h
src/osd/OSD.cc

diff --cc src/Makefile.am
index e958e22cc861d536b0299b098f846fa41ed50368,21f2b3d88fc5dc74220fdced604309b1ae8a6783..05bdb628abe7414b088ad034555f23f96f35df0c
@@@ -60,9 -58,12 +60,12 @@@ csyn_LDADD = libclient.a libosdc.a libc
  bin_PROGRAMS += csyn
  
  testmsgr_SOURCES = testmsgr.cc msg/SimpleMessenger.cc
 -testmsgr_LDADD = libcommon.a
 +testmsgr_LDADD = libcommon.a -lcrypto
  bin_PROGRAMS += testmsgr
  
+ test_ioctls_SOURCES = client/test_ioctls.c
+ bin_PROGRAMS += test_ioctls
  # fuse targets?
  if WITH_FUSE
  cfuse_SOURCES = cfuse.cc msg/SimpleMessenger.cc client/fuse.cc client/fuse_ll.cc
diff --cc src/ceph.cc
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc src/librados.cc
Simple merge
Simple merge
index c2e74f63c9b6dc58c0cbb9328d3844c14d4abc82,ac84ebc930c740f62322ac0821d4b2edf8247302..3d14628d6ec16622b83a5310adf89ef6dd7e9fa4
@@@ -282,33 -291,49 +314,54 @@@ int MonClient::authenticate(double time
  
  void MonClient::_send_mon_message(Message *m)
  {
-   int mon = monmap.pick_mon();
-   messenger->send_message(m, monmap.mon_inst[mon]);
+   assert(cur_mon >= 0);
+   messenger->send_message(m, monmap.mon_inst[cur_mon]);
  }
  
 +void MonClient::send_message(Message *m)
 +{
 +  _send_mon_message(m);
 +}
 +
  void MonClient::_pick_new_mon()
  {
-   int oldmon = monmap.pick_mon();
-   messenger->mark_down(monmap.get_inst(oldmon).addr);
-   monmap.pick_mon(true);
+   if (cur_mon >= 0)
+     messenger->mark_down(monmap.get_inst(cur_mon).addr);
+   cur_mon = monmap.pick_mon(true);
+   dout(10) << "_pick_new_mon picked mon" << cur_mon << dendl;
  }
  
- void MonClient::ms_handle_reset(const entity_addr_t& peer)
 -
+ void MonClient::_reopen_session()
  {
-   dout(10) << "ms_handle_reset " << peer << dendl;
-   if (!hunting) {
-     dout(0) << "staring hunt for new mon" << dendl;
-     hunting = true;
-     _pick_new_mon();
-     auth.start_session(this, 30.0);
-     if (mounting)
-       _send_mount();
+   dout(10) << "_reopen_session" << dendl;
+   _pick_new_mon();
++  auth.start_session(this, 30.0);
+   if (mounting)
+     _send_mount();
+   if (!sub_have.empty())
      _renew_subs();
+   if (!mounting && sub_have.empty()) {
+     _send_mon_message(new MMonGetMap);
+   }
+ }
+ bool MonClient::ms_handle_reset(Connection *con, const entity_addr_t& peer)
+ {
+   dout(10) << "ms_handle_reset " << peer << dendl;
+   if (hunting)
+     return true;
+   dout(0) << "hunting for new mon" << dendl;
+   hunting = true;
+   _reopen_session();
+   return false;
+ }
+ void MonClient::_finish_hunting()
+ {
+   if (hunting) {
+     dout(0) << "found mon" << cur_mon << dendl; 
+     hunting = false;
    }
  }
  
@@@ -318,12 -343,7 +371,8 @@@ void MonClient::tick(
  
    if (hunting) {
      dout(0) << "continuing hunt" << dendl;
-     // try new monitor
-     _pick_new_mon();
-     if (mounting)
-       _send_mount();
-     _renew_subs();
 +    auth.start_session(this, 30.0);
+     _reopen_session();
    } else {
      // just renew as needed
      utime_t now = g_clock.now();
      messenger->send_keepalive(monmap.mon_inst[oldmon]);
    }
  
 +  auth.tick();
 +
    timer.add_event_after(10.0, new C_Tick(this));
-   dout(10) << "tick done" << dendl;
  }
  
  
index c411b786f82b77de2647dfe327b414f4aae6128e,dcde7ecb964b38849414031530146e96833287c8..479b4e8b6cf7b4ec765d94f34df1d8d13aa08c83
@@@ -39,7 -36,8 +39,12 @@@ public
  private:
    Messenger *messenger;
  
++<<<<<<< HEAD:src/mon/MonClient.h
 +  bufferlist tgt;
++=======
+   int cur_mon;
++>>>>>>> origin/unstable:src/mon/MonClient.h
    entity_addr_t my_addr;
  
    Mutex monc_lock;
    };
    void tick();
  
 +  Context *auth_timeout_event;
 +  bool auth_got_timeout;
 +  Cond auth_cond;
 +
 +  class C_AuthRotatingTimeout : public Context {
 +  protected:
 +    MonClient *client;
 +    double timeout;
 +  public:
 +    C_AuthRotatingTimeout(MonClient *c, double to) :
 +                                        client(c), timeout(to) {
 +    }
 +    void finish(int r) {
 +      if (r >= 0) client->_auth_rotating_timeout(timeout);
 +    }
 +  };
 +
 +  void handle_auth_rotating_response(MAuthRotating *m);
+   // monclient
+   bool want_monmap;
    // mount
  private:
    client_t clientid;
@@@ -142,14 -113,27 +146,30 @@@ private
      }
    }
  
 +  // auth tickets
 +public:
 +  AuthClientHandler auth;
 +  double auth_timeout;
+ public:
+   void renew_subs() {
+     Mutex::Locker l(monc_lock);
+     _renew_subs();
+   }
+   void sub_want(nstring what, version_t have) {
+     Mutex::Locker l(monc_lock);
+     _sub_want(what, have);
+   }
+   void sub_want_onetime(nstring what, version_t have) {
+     Mutex::Locker l(monc_lock);
+     _sub_want_onetime(what, have);
+   }
+   void sub_got(nstring what, version_t have) {
+     Mutex::Locker l(monc_lock);
+     _sub_got(what, have);
+   }
+   
 -
   public:
-   MonClient() : messenger(NULL),
+   MonClient() : messenger(NULL), cur_mon(-1),
                monc_lock("MonClient::monc_lock"),
                timer(monc_lock),
                hunting(false),
Simple merge
Simple merge
Simple merge
diff --cc src/osd/OSD.cc
Simple merge