From 62645d30b0ceee075a56bc692fd65cee85b09aa5 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Mon, 30 Mar 2015 17:34:57 -0700 Subject: [PATCH] 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 --- src/cls/rgw/cls_rgw.cc | 3 ++- src/cls/rgw/cls_rgw_types.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cls/rgw/cls_rgw.cc b/src/cls/rgw/cls_rgw.cc index 7a15a90f9ebc5..e69b59eeccb33 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 1ed56ba0da895..6abc831c8a303 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; -- 2.39.5