]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: orphan: flush bucket index entries only after map is full
authorAbhishek Lekshmanan <abhishek@suse.com>
Wed, 13 Feb 2019 12:32:43 +0000 (13:32 +0100)
committerNathan Cutler <ncutler@suse.com>
Thu, 30 May 2019 13:05:34 +0000 (15:05 +0200)
We otherwise may flush more regularly while we don't have enough entries in the
map

Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
(cherry picked from commit e9a406c9b036e4c3190077d57fc51d6ea3762475)

src/rgw/rgw_orphan.cc

index d034f584a3667af8ba7a6b2742ac082480dd64ee..7cdf53a4ab7690a9e45af7515b755e68dcd54342 100644 (file)
@@ -188,9 +188,10 @@ int RGWOrphanSearch::init(const string& job_name, RGWOrphanSearchInfo *info) {
     return r;
   }
 
-  constexpr auto MAX_LIST_OBJS_ENTRIES = 100;
+  constexpr int64_t MAX_LIST_OBJS_ENTRIES=100;
+
   max_list_bucket_entries = std::max(store->ctx()->_conf->rgw_list_bucket_min_readahead,
-                                     MAX_LIST_OBJS_ENTRIES)
+                                     MAX_LIST_OBJS_ENTRIES);
 
   RGWOrphanSearchState state;
   r = orphan_store.read_job(job_name, state);
@@ -498,8 +499,6 @@ int RGWOrphanSearch::build_linked_oids_for_bucket(const string& bucket_instance_
 
   deque<RGWRados::Object::Stat> stat_ops;
 
-  int count = 0;
-
   do {
     vector<rgw_bucket_dir_entry> result;
 
@@ -540,13 +539,12 @@ int RGWOrphanSearch::build_linked_oids_for_bucket(const string& bucket_instance_
           }
         }
       }
-      if (++count >= COUNT_BEFORE_FLUSH) {
+      if (oids.size() >= COUNT_BEFORE_FLUSH) {
         ret = log_oids(linked_objs_index, oids);
         if (ret < 0) {
           cerr << __func__ << ": ERROR: log_oids() returned ret=" << ret << std::endl;
           return ret;
         }
-        count = 0;
         oids.clear();
       }
     }