Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rgw: fix versioned bucket data sync fail when upload is busy #12357

Merged
merged 1 commit into from Jan 18, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 4 additions & 7 deletions src/rgw/rgw_data_sync.cc
Expand Up @@ -2416,7 +2416,7 @@ class RGWBucketShardIncrementalSyncCR : public RGWCoroutine {
boost::intrusive_ptr<RGWContinuousLeaseCR> lease_cr;
list<rgw_bi_log_entry> list_result;
list<rgw_bi_log_entry>::iterator entries_iter;
map<string, pair<real_time, RGWModifyOp> > squash_map;
map<pair<string, string>, pair<real_time, RGWModifyOp> > squash_map;
rgw_bucket_shard_inc_sync_marker& inc_marker;
rgw_obj_key key;
rgw_bi_log_entry *entry{nullptr};
Expand Down Expand Up @@ -2476,11 +2476,8 @@ int RGWBucketShardIncrementalSyncCR::operate()
if (e.state != CLS_RGW_STATE_COMPLETE) {
continue;
}
auto& squash_entry = squash_map[e.object];
if (squash_entry.first == e.timestamp &&
e.op == CLS_RGW_OP_DEL) {
squash_entry.second = e.op;
} else if (squash_entry.first < e.timestamp) {
auto& squash_entry = squash_map[make_pair(e.object, e.instance)];
if (squash_entry.first <= e.timestamp) {
squash_entry = make_pair<>(e.timestamp, e.op);
}
}
Expand Down Expand Up @@ -2533,7 +2530,7 @@ int RGWBucketShardIncrementalSyncCR::operate()
marker_tracker.try_update_high_marker(cur_id, 0, entry->timestamp);
continue;
}
if (make_pair<>(entry->timestamp, entry->op) != squash_map[entry->object]) {
if (make_pair<>(entry->timestamp, entry->op) != squash_map[make_pair(entry->object, entry->instance)]) {
set_status() << "squashed operation, skipping";
ldout(sync_env->cct, 20) << "[inc sync] skipping object: "
<< bucket_shard_str{bs} << "/" << key << ": squashed operation" << dendl;
Expand Down