osd: zero ondisklog pointers when starting pg deletion

This fixes a problem where the osd stops part way through pg cleanup.  It
seens the old ondisklog bounds, but then fails to load the log, and crashes
on startup.

We just need to zero the ondisklog bounds when we zero the log.

Signed-off-by: Sage Weil <sage@newdream.net>
This commit is contained in:
Sage Weil 2010-07-23 11:45:26 -07:00
parent 16c0fea256
commit e986721b06
2 changed files with 7 additions and 0 deletions

View File

@ -3821,6 +3821,7 @@ void OSD::_remove_pg(PG *pg)
// reset log, last_complete, in case deletion gets canceled
pg->info.last_complete = eversion_t();
pg->log.zero();
pg->ondisklog.zero();
{
ObjectStore::Transaction *t = new ObjectStore::Transaction;

View File

@ -480,6 +480,12 @@ public:
uint64_t length() { return head - tail; }
bool trim_to(eversion_t v, ObjectStore::Transaction& t);
void zero() {
tail = 0;
head = 0;
block_map.clear();
}
void encode(bufferlist& bl) const {
__u8 struct_v = 1;
::encode(struct_v, bl);