Merge pull request #2088 from guangyy/wip-8733

Fix the PG listing issue which could miss objects for EC pool

Reviewed-by: Samuel Just <sam.just@inktank.com>
This commit is contained in:
Samuel Just 2014-07-11 10:20:04 -07:00
commit f9d0e8ff10
2 changed files with 10 additions and 2 deletions

View File

@ -610,7 +610,11 @@ int ObjectStore::collection_list_range(coll_t c, hobject_t start, hobject_t end,
snapid_t seq, vector<hobject_t> *ls)
{
vector<ghobject_t> go;
ghobject_t gstart(start), gend(end);
// Starts with the smallest shard id and generation to
// make sure the result list has the marker object
ghobject_t gstart(start, 0, shard_id_t(0));
// Exclusive end, choose the smallest end ghobject
ghobject_t gend(end, 0, shard_id_t(0));
int ret = collection_list_range(c, gstart, gend, seq, &go);
if (ret == 0) {
ls->reserve(go.size());

View File

@ -116,7 +116,11 @@ int PGBackend::objects_list_partial(
hobject_t *next)
{
assert(ls);
ghobject_t _next(begin);
// Starts with the smallest shard id and generation to
// make sure the result list has the marker object (
// it might have multiple generations though, which would
// be filtered).
ghobject_t _next(begin, 0, shard_id_t(0));
ls->reserve(max);
int r = 0;
while (!_next.is_max() && ls->size() < (unsigned)min) {