]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cls_rgw: use multimap to keep pending operations in bucket index
authorYehuda Sadeh <yehuda@redhat.com>
Tue, 31 Mar 2015 00:34:57 +0000 (17:34 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Tue, 5 May 2015 20:17:58 +0000 (13:17 -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>
(cherry picked from commit 4e6a66b55e73c01347fc3330faa5c1307d29e9d3)

src/cls/rgw/cls_rgw.cc
src/cls/rgw/cls_rgw_types.h

index 7dc3af98a951e1cddad39eb7fca7055c87322aee..db488e40fb62c7fc800f2260d196eea5263d9af2 100644 (file)
@@ -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<string, rgw_bucket_pending_info>(op.tag, info));
 
   struct rgw_bucket_dir_header header;
   rc = read_bucket_header(hctx, &header);
index 77f86113709152a8ede998669c2b1d4bb8f0d53a..dfa9286c0008e2e970d68b498b0537e429b1d63f 100644 (file)
@@ -268,7 +268,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;
   uint16_t flags;