]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cls_rgw: use multimap to keep pending operations in bucket index 4571/head
authorYehuda Sadeh <yehuda@redhat.com>
Tue, 31 Mar 2015 00:34:57 +0000 (17:34 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Tue, 31 Mar 2015 00:34:57 +0000 (17:34 -0700)
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 <yehuda@redhat.com>
src/cls/rgw/cls_rgw.cc
src/cls/rgw/cls_rgw_types.h

index 7a15a90f9ebc5ea10f1c0518f12747a9b63107fb..e69b59eeccb330d3d35a3fdddf7a27bff0093466 100644 (file)
@@ -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<string, rgw_bucket_pending_info>(op.tag, info));
 
 
   bufferlist header_bl;
index 1ed56ba0da89556c6b797a648c7ec9c7853fb0d7..6abc831c8a3030168ccc47882ae3f73f76feb38f 100644 (file)
@@ -200,7 +200,7 @@ struct rgw_bucket_dir_entry {
   std::string locator;
   bool exists;
   struct rgw_bucket_dir_entry_meta meta;
-  map<string, struct rgw_bucket_pending_info> pending_map;
+  multimap<string, struct rgw_bucket_pending_info> pending_map;
   uint64_t index_ver;
   string tag;