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.94.2~30 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7c7e651a0ae8bbcebe136da74b7dbe3a3e9edcc8;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 (cherry picked from commit 4e6a66b55e73c01347fc3330faa5c1307d29e9d3) --- diff --git a/src/cls/rgw/cls_rgw.cc b/src/cls/rgw/cls_rgw.cc index 7dc3af98a951..db488e40fb62 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 77f861137091..dfa9286c0008 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;