]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: drop entries only if the markers do not match.
authorAbhishek Lekshmanan <abhishek@suse.com>
Tue, 5 Mar 2019 08:30:57 +0000 (09:30 +0100)
committerDongdong Tao <dongdong.tao@canonical.com>
Thu, 1 Aug 2019 15:47:34 +0000 (15:47 +0000)
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
(cherry picked from commit 3a5647f748185e3a3fc2602a132874c0dfb24368)

Conflicts:
    src/rgw/rgw_lc.cc
- rgw_lc.cc has changed much since luminous

src/rgw/rgw_lc.cc

index f98eabc0486b518c112b46ba046fc49581067cf9..0dcfc592435ff299dea0e1ebec12a3332411a586 100644 (file)
@@ -347,16 +347,17 @@ int RGWLC::bucket_lc_process(string& shard_id)
   boost::split(result, shard_id, boost::is_any_of(":"));
   string bucket_tenant = result[0];
   string bucket_name = result[1];
-  string bucket_id = result[2];
+  string bucket_marker = result[2];
   int ret = store->get_bucket_info(obj_ctx, bucket_tenant, bucket_name, bucket_info, NULL, &bucket_attrs);
   if (ret < 0) {
     ldout(cct, 0) << "LC:get_bucket_info failed" << bucket_name <<dendl;
     return ret;
   }
 
-  ret = bucket_info.bucket.bucket_id.compare(bucket_id) ;
-  if (ret !=0) {
-    ldout(cct, 0) << "LC:old bucket id find, should be delete" << bucket_name <<dendl;
+  if (bucket_info.bucket.marker != bucket_marker) {
+    ldout(cct, 0) << "LC: deleting stale entry found for bucket=" << bucket_tenant
+                       << ":" << bucket_name << " cur_marker=" << bucket_info.bucket.marker
+                       << " orig_marker=" << bucket_marker << dendl;
     return -ENOENT;
   }