osd: always write backlog after creation

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>
This commit is contained in:
Sage Weil 2011-02-08 08:20:19 -08:00
parent 19afe11cc5
commit 3055d09441

View 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);
}