]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: set client incarnation for Objecter instance
authorSage Weil <sage@inktank.com>
Sun, 16 Feb 2014 01:22:30 +0000 (17:22 -0800)
committerSage Weil <sage@inktank.com>
Sun, 16 Feb 2014 06:09:40 +0000 (22:09 -0800)
Each ceph-osd process's Objecter instance has a sequence
of tid's that start at 1.  To ensure these are unique
across all time, set the client incarnation to the
OSDMap epoch in which we booted.

Note that the MDS does something similar (except the
incarnation is actually the restart count for the MDS
rank, since the MDSMap tracks that explicitly).

Backport: emperor
Signed-off-by: Sage Weil <sage@inktank.com>
src/osd/OSD.cc

index da1a75b468e57fe42e5e717569069cd163d99e03..88f3919ac1e8d19a79413381d50e80ddffa47e6c 100644 (file)
@@ -5290,6 +5290,10 @@ void OSD::handle_osd_map(MOSDMap *m)
     if (is_booting()) {
       dout(1) << "state: booting -> active" << dendl;
       state = STATE_ACTIVE;
+
+      // set incarnation so that osd_reqid_t's we generate for our
+      // objecter requests are unique across restarts.
+      service.objecter->set_client_incarnation(osdmap->get_epoch());
     }
   }