}
RGWReplicaBucketLogger logger(store);
- ret = logger.get_bounds(bucket, bounds);
+ ret = logger.get_bounds(bucket, shard_id, bounds);
if (ret < 0)
return -ret;
} else { // shouldn't get here
}
RGWReplicaBucketLogger logger(store);
- ret = logger.delete_bound(bucket, daemon_id);
+ ret = logger.delete_bound(bucket, shard_id, daemon_id);
if (ret < 0)
return -ret;
}
prefix = _store->ctx()->_conf->rgw_replica_log_obj_prefix;
prefix.append(".");
}
+
+string RGWReplicaBucketLogger::obj_name(const rgw_bucket& bucket, int shard_id)
+{
+ string s = prefix + bucket.name;
+
+ if (shard_id >= 0) {
+ char buf[16];
+ snprintf(buf, sizeof(buf), ".%d", shard_id);
+ s += buf;
+ }
+ return s;
+}
class RGWReplicaBucketLogger : private RGWReplicaLogger {
string pool;
string prefix;
+
+ string obj_name(const rgw_bucket& bucket, int shard_id);
public:
RGWReplicaBucketLogger(RGWRados *_store);
- int update_bound(const rgw_bucket& bucket, const string& daemon_id,
+ int update_bound(const rgw_bucket& bucket, int shard_id, const string& daemon_id,
const string& marker, const utime_t& time,
const list<RGWReplicaItemMarker> *entries) {
- return RGWReplicaLogger::update_bound(prefix+bucket.name, pool,
+ return RGWReplicaLogger::update_bound(obj_name(bucket, shard_id), pool,
daemon_id, marker, time, entries);
}
- int delete_bound(const rgw_bucket& bucket, const string& daemon_id) {
- return RGWReplicaLogger::delete_bound(prefix+bucket.name, pool,
+ int delete_bound(const rgw_bucket& bucket, int shard_id, const string& daemon_id) {
+ return RGWReplicaLogger::delete_bound(obj_name(bucket, shard_id), pool,
daemon_id);
}
- int get_bounds(const rgw_bucket& bucket, RGWReplicaBounds& bounds) {
- return RGWReplicaLogger::get_bounds(prefix+bucket.name, pool,
+ int get_bounds(const rgw_bucket& bucket, int shard_id, RGWReplicaBounds& bounds) {
+ return RGWReplicaLogger::get_bounds(obj_name(bucket, shard_id), pool,
bounds);
}
};
return;
}
+ int shard_id;
+ http_ret = rgw_bucket_parse_bucket_instance(bucket_instance, &bucket_instance, &shard_id);
+ if (http_ret < 0) {
+ dout(5) << "failed to parse bucket instance" << dendl;
+ return;
+ }
+
rgw_bucket bucket;
if ((http_ret = bucket_instance_to_bucket(store, bucket_instance, bucket)) < 0)
return;
return;
}
- http_ret = rl.update_bound(bucket, daemon_id, marker, ut, &markers);
+ http_ret = rl.update_bound(bucket, shard_id, daemon_id, marker, ut, &markers);
}
void RGWOp_BILog_GetBounds::execute() {
return;
}
+ int shard_id;
+ http_ret = rgw_bucket_parse_bucket_instance(bucket_instance, &bucket_instance, &shard_id);
+ if (http_ret < 0) {
+ dout(5) << "failed to parse bucket instance" << dendl;
+ return;
+ }
+
rgw_bucket bucket;
if ((http_ret = bucket_instance_to_bucket(store, bucket_instance, bucket)) < 0)
return;
RGWReplicaBucketLogger rl(store);
- http_ret = rl.get_bounds(bucket, bounds);
+ http_ret = rl.get_bounds(bucket, shard_id, bounds);
}
void RGWOp_BILog_GetBounds::send_response() {
return;
}
+ int shard_id;
+ http_ret = rgw_bucket_parse_bucket_instance(bucket_instance, &bucket_instance, &shard_id);
+ if (http_ret < 0) {
+ dout(5) << "failed to parse bucket instance" << dendl;
+ return;
+ }
+
rgw_bucket bucket;
if ((http_ret = bucket_instance_to_bucket(store, bucket_instance, bucket)) < 0)
return;
RGWReplicaBucketLogger rl(store);
- http_ret = rl.delete_bound(bucket, daemon_id);
+ http_ret = rl.delete_bound(bucket, shard_id, daemon_id);
}
RGWOp *RGWHandler_ReplicaLog::op_get() {