]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
filer: set RMW bit on probe
authorSage Weil <sage@newdream.net>
Thu, 10 Mar 2011 19:20:54 +0000 (11:20 -0800)
committerSage Weil <sage@newdream.net>
Thu, 10 Mar 2011 19:20:54 +0000 (11:20 -0800)
Setting the RMW bits on the probe stat call will make the OSD wait for
pending writes on the object to flush to disk.  This was a problem for MDS
takeover: the old instance had writes mid-commit on the OSD when the
journal probe/stat came in, and it didn't "see" the size change because
the PG was in 'delayed' mode and the old MDS's write hadn't been queued
for disk locally.  Simply claiming we are a RMW op will force the PG
into rmw mode so that we know the prior write will be visible.  This is
just fine for the metadata workload.

Fixes: #805
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/osdc/Filer.cc

index 18aa2fb19c610ce525c8285d44a827970ac254b7..4690ce9b6e884925ff45555731f90016a3e87798 100644 (file)
@@ -107,7 +107,8 @@ void Filer::_probe(Probe *probe)
        p++) {
     dout(10) << "_probe  probing " << p->oid << dendl;
     C_Probe *c = new C_Probe(this, probe, p->oid);
-    probe->ops[p->oid] = objecter->stat(p->oid, p->oloc, probe->snapid, &c->size, &c->mtime, probe->flags, c);
+    probe->ops[p->oid] = objecter->stat(p->oid, p->oloc, probe->snapid, &c->size, &c->mtime, 
+                                       probe->flags | CEPH_OSD_FLAG_WRITE, c);
   }
 }