From: Yehuda Sadeh Date: Tue, 31 Mar 2015 00:34:57 +0000 (-0700) Subject: cls_rgw: use multimap to keep pending operations in bucket index X-Git-Tag: v0.80.10~19^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=62645d30b0ceee075a56bc692fd65cee85b09aa5;p=ceph.git cls_rgw: use multimap to keep pending operations in bucket index Fixes: #11256 Multiple concurrent requests might be sent using the same tag, need the entry map to be able to hold multiple entries. Signed-off-by: Yehuda Sadeh --- diff --git a/src/cls/rgw/cls_rgw.cc b/src/cls/rgw/cls_rgw.cc index 7a15a90f9eb..e69b59eeccb 100644 --- a/src/cls/rgw/cls_rgw.cc +++ b/src/cls/rgw/cls_rgw.cc @@ -453,10 +453,11 @@ int rgw_bucket_prepare_op(cls_method_context_t hctx, bufferlist *in, bufferlist } // fill in proper state - struct rgw_bucket_pending_info& info = entry.pending_map[op.tag]; + struct rgw_bucket_pending_info info; info.timestamp = ceph_clock_now(g_ceph_context); info.state = CLS_RGW_STATE_PENDING_MODIFY; info.op = op.op; + entry.pending_map.insert(pair(op.tag, info)); bufferlist header_bl; diff --git a/src/cls/rgw/cls_rgw_types.h b/src/cls/rgw/cls_rgw_types.h index 1ed56ba0da8..6abc831c8a3 100644 --- a/src/cls/rgw/cls_rgw_types.h +++ b/src/cls/rgw/cls_rgw_types.h @@ -200,7 +200,7 @@ struct rgw_bucket_dir_entry { std::string locator; bool exists; struct rgw_bucket_dir_entry_meta meta; - map pending_map; + multimap pending_map; uint64_t index_ver; string tag;