]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: only trim pg log if pg is complete
authorSage Weil <sage@newdream.net>
Thu, 23 Apr 2009 17:22:49 +0000 (10:22 -0700)
committerSage Weil <sage@newdream.net>
Thu, 23 Apr 2009 17:22:49 +0000 (10:22 -0700)
Good policy.  And log.trim() so asserts.

src/osd/PG.cc

index e7477842eb61e521ee52741f6c5033e0346b7f49..f009e325908dafb93a32f3bb831c8750dd4c9b2d 100644 (file)
@@ -1715,7 +1715,7 @@ void PG::append_log(ObjectStore::Transaction &t, bufferlist& bl,
 
   
   // trim?
-  if (trim_to > log.bottom) {
+  if (is_complete() && trim_to > log.bottom) {
     dout(10) << " trimming " << log << " to " << trim_to << dendl;
     log.trim(t, trim_to);
     info.log_bottom = log.bottom;