]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: always write backlog after creation
authorSage Weil <sage.weil@dreamhost.com>
Tue, 8 Feb 2011 16:20:19 +0000 (08:20 -0800)
committerSage Weil <sage.weil@dreamhost.com>
Tue, 8 Feb 2011 16:22:47 +0000 (08:22 -0800)
dirty_log is never set to true, so we would set the log.backlog flag but
not write it to disk.  If we restarted the OSD, we would think we had the
backlog in the log but in reality we would not.  clean_up_local() could
then erase almost every object in the PG.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/osd/OSD.cc

index bf2da5a2193403497b2c23c2c17fabb8bf884e21..2983d6847791457db60aca954ee7ae5a824a81d4 100644 (file)
@@ -4593,10 +4593,8 @@ void OSD::generate_backlog(PG *pg)
     C_Contexts *fin = new C_Contexts;
     pg->do_peer(*t, fin->contexts, query_map, NULL);
     do_queries(query_map);
-    if (pg->dirty_info)
-      pg->write_info(*t);
-    if (pg->dirty_log)
-      pg->write_log(*t);
+    pg->write_info(*t);
+    pg->write_log(*t);
     int tr = store->queue_transaction(&pg->osr, t, new ObjectStore::C_DeleteTransaction(t), fin);
     assert(tr == 0);
   }