From 62a99817559bcac6d1c48af27a0f0a0081ad248d 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 (cherry picked from commit 4e6a66b55e73c01347fc3330faa5c1307d29e9d3) --- 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 7dc3af98a951e..db488e40fb62c 100644 --- a/src/cls/rgw/cls_rgw.cc +++ b/src/cls/rgw/cls_rgw.cc @@ -657,10 +657,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)); struct rgw_bucket_dir_header header; rc = read_bucket_header(hctx, &header); diff --git a/src/cls/rgw/cls_rgw_types.h b/src/cls/rgw/cls_rgw_types.h index 77f8611370915..dfa9286c0008e 100644 --- a/src/cls/rgw/cls_rgw_types.h +++ b/src/cls/rgw/cls_rgw_types.h @@ -268,7 +268,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; uint16_t flags; -- 2.39.5