]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pgmon: create ALL pgs in new pools with correct creation epoch
authorGreg Farnum <gregory.farnum@dreamhost.com>
Fri, 5 Aug 2011 18:07:03 +0000 (11:07 -0700)
committerGreg Farnum <gregory.farnum@dreamhost.com>
Fri, 5 Aug 2011 18:07:03 +0000 (11:07 -0700)
5bb07df6aa4684ebd2e70437081dea170464d8ee tried to do this, but it
only set them properly for localized PGs. Whoops!
Additionally, we do NOT want to do this for new PGs in pre-existing
pools. Unfortunately, we have no way of guaranteeing that these new
PGs in old pools have the right epoch -- the data doesn't exist.
I'll discuss with other team members; it's possible that last_change
is in fact supposed to deal with this and simply doesn't.
Meanwhile, I've created a new bug to track this: #1365.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
src/mon/PGMonitor.cc

index 5670b95e5e5a82c14049dedef9abeb57a0c0c541..615aaf23f206d021a9a25dbfe22b9747dd305ae4 100644 (file)
@@ -638,7 +638,8 @@ bool PGMonitor::register_new_pgs()
        continue;
       }
       created++;
-      register_pg(pool, pgid, epoch, new_pool);
+      register_pg(pool, pgid, new_pool ? pool.get_last_change() : epoch,
+                  new_pool);
     }
 
     for (ps_t ps = 0; ps < pool.get_lpg_num(); ps++) {
@@ -649,7 +650,8 @@ bool PGMonitor::register_new_pgs()
          continue;
        }
        created++;
-       register_pg(pool, pgid, pool.get_last_change(), new_pool);
+       register_pg(pool, pgid, new_pool? pool.get_last_change() : epoch,
+                   new_pool);
       }
     }
   }