mirror of
https://github.com/ceph/ceph
synced 2025-01-10 21:20:46 +00:00
osd: clean out temp pg on startup
This commit is contained in:
parent
e0b6255750
commit
2e137c9a0f
@ -479,6 +479,8 @@ int OSD::init()
|
||||
osdmap->decode(bl);
|
||||
}
|
||||
|
||||
clear_temp();
|
||||
|
||||
// load up pgs (as they previously existed)
|
||||
load_pgs();
|
||||
|
||||
@ -774,6 +776,28 @@ int OSD::read_superblock()
|
||||
|
||||
|
||||
|
||||
void OSD::clear_temp()
|
||||
{
|
||||
dout(10) << "clear_temp" << dendl;
|
||||
|
||||
vector<sobject_t> objects;
|
||||
store->collection_list(temp_coll, objects);
|
||||
|
||||
dout(10) << objects.size() << " objects" << dendl;
|
||||
if (objects.empty())
|
||||
return;
|
||||
|
||||
// delete them.
|
||||
ObjectStore::Transaction *t = new ObjectStore::Transaction;
|
||||
for (vector<sobject_t>::iterator p = objects.begin();
|
||||
p != objects.end();
|
||||
p++)
|
||||
t->collection_remove(temp_coll, *p);
|
||||
int r = store->queue_transaction(NULL, t);
|
||||
assert(r == 0);
|
||||
store->sync_and_flush();
|
||||
dout(10) << "done" << dendl;
|
||||
}
|
||||
|
||||
|
||||
// ======================================================
|
||||
|
@ -520,6 +520,8 @@ protected:
|
||||
|
||||
// -- boot --
|
||||
void send_boot();
|
||||
|
||||
void clear_temp();
|
||||
|
||||
// -- alive --
|
||||
epoch_t up_thru_wanted;
|
||||
|
Loading…
Reference in New Issue
Block a user