From e986721b06973a9379a37961e49ce334c480fa1a Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 23 Jul 2010 11:45:26 -0700 Subject: [PATCH] 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 --- src/osd/OSD.cc | 1 + src/osd/PG.h | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index acc44ae66b5..762016b1f85 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -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; diff --git a/src/osd/PG.h b/src/osd/PG.h index 6157aee0f43..3a59cf11a59 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -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);