From: Yehuda Sadeh Date: Thu, 29 Jan 2015 00:36:47 +0000 (-0800) Subject: rgw: also convert sharded replicalog entries X-Git-Tag: v0.93~165^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ca214c96cb02f447f9db340390621ed37c97ed5e;p=ceph.git rgw: also convert sharded replicalog entries Signed-off-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_replica_log.cc b/src/rgw/rgw_replica_log.cc index 977b2ef96c63..6d8ed096da67 100644 --- a/src/rgw/rgw_replica_log.cc +++ b/src/rgw/rgw_replica_log.cc @@ -211,22 +211,14 @@ int RGWReplicaBucketLogger::update_bound(const rgw_bucket& bucket, int shard_id, ret = 0; - bool no_shards = (vals.size() == 1); - map::iterator iter; for (iter = vals.begin(); iter != vals.end(); ++iter) { - bool need_to_exist = no_shards; /* - * we only care about non-sharded - * buckets, as these are the ones that - * might not be indexed by instance id, and - * might need conversion - */ ldout(cct, 20) << "updating bound: bucket=" << bucket << " shard=" << iter->first << " marker=" << marker << dendl; int r = RGWReplicaLogger::update_bound(obj_name(bucket, iter->first, true), pool, daemon_id, iter->second, time, entries, - need_to_exist); + true /* need to exist */); - if (r == -ENOENT && need_to_exist) { + if (r == -ENOENT) { RGWReplicaBounds bounds; r = convert_old_bounds(bucket, -1, bounds); if (r < 0 && r != -ENOENT) { @@ -246,8 +238,7 @@ int RGWReplicaBucketLogger::update_bound(const rgw_bucket& bucket, int shard_id, int RGWReplicaBucketLogger::delete_bound(const rgw_bucket& bucket, int shard_id, const string& daemon_id, bool purge_all) { - bool need_to_exist = (shard_id < 0); /* don't need to exist if sharded */ - int r = RGWReplicaLogger::delete_bound(obj_name(bucket, shard_id, true), pool, daemon_id, purge_all, need_to_exist); + int r = RGWReplicaLogger::delete_bound(obj_name(bucket, shard_id, true), pool, daemon_id, purge_all, true /* need to exist */); if (r != -ENOENT) { return r; } @@ -265,7 +256,7 @@ int RGWReplicaBucketLogger::delete_bound(const rgw_bucket& bucket, int shard_id, int RGWReplicaBucketLogger::get_bounds(const rgw_bucket& bucket, int shard_id, RGWReplicaBounds& bounds) { int r = RGWReplicaLogger::get_bounds(obj_name(bucket, shard_id, true), pool, bounds); - if (r != -ENOENT || shard_id >= 0) { + if (r != -ENOENT) { return r; }