Merge PR #37037 into master

* refs/pull/37037/head:
	mds: fix purge_queue's _calculate_ops is inaccurate

Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
This commit is contained in:
Patrick Donnelly 2020-09-18 17:23:32 -07:00
commit b64c3784f0
No known key found for this signature in database
GPG Key ID: 3A2A7E25BEA8AADB

View File

@ -371,14 +371,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();