]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix purge_queue's _calculate_ops is inaccurate 37372/head
authorYanhu Cao <gmayyyha@gmail.com>
Tue, 8 Sep 2020 06:20:12 +0000 (14:20 +0800)
committerNathan Cutler <ncutler@suse.com>
Wed, 23 Sep 2020 13:19:10 +0000 (15:19 +0200)
No need to account for removing (or zeroing) backtrace,
because if item.size is 0, num is already set to 1.

Fixes: https://tracker.ceph.com/issues/47353
Signed-off-by: Yanhu Cao <gmayyyha@gmail.com>
(cherry picked from commit 8a54e03f29e19af2072751fe2816b5313ff18abe)

src/mds/PurgeQueue.cc

index eace818ec3d8fec63854d175d8df526c5f05ac93..234bc713ab032318baf3bfccf196ab0b42bac544 100644 (file)
@@ -367,14 +367,12 @@ uint32_t PurgeQueue::_calculate_ops(const PurgeItem &item) const
     ops_required = 1 + leaves.size();
   } else {
     // File, work out concurrent Filer::purge deletes
+    // Account for removing (or zeroing) backtrace
     const uint64_t num = (item.size > 0) ?
       Striper::get_num_objects(item.layout, item.size) : 1;
 
     ops_required = std::min(num, g_conf()->filer_max_purge_ops);
 
-    // Account for removing (or zeroing) backtrace
-    ops_required += 1;
-
     // Account for deletions for old pools
     if (item.action != PurgeItem::TRUNCATE_FILE) {
       ops_required += item.old_pools.size();