]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
mds/PurgeQueue: don't consider filer_max_purge_ops when _calculate_ops 48786/head
authorhaoyixing <haoyixing@kuaishou.com>
Tue, 8 Nov 2022 08:13:38 +0000 (16:13 +0800)
committerhaoyixing <haoyixing@kuaishou.com>
Mon, 21 Nov 2022 01:30:24 +0000 (09:30 +0800)
commit37370ed8980841404b17b28a0191b8ba16172566
tree4365841534a41aeb3bfe5c1e49aa570d171416cf
parent895a2f320822d9ee528986adb458d9202a0dbcab
mds/PurgeQueue: don't consider filer_max_purge_ops when _calculate_ops

_calculate_ops relying on a config which can be modified on the fly will cause a bug. e.g.
1. A file has 20 objects and filer_max_purge_ops config was 10.
2. calling PurgeQueue::_execute_item and _calculate_ops returns 10, so ops_in_flight add 10.
3. adjust filer_max_purge_ops to 20 on the fly
4. calling PurgeQueue::_execute_item_complete and _calculate_ops returns 20, so ops_in_flight dec 20.
5. since ops_in_flight is uint64, this cause an overflow which makes ops_in_flight far more
greater than max_purge_ops and can't go back to a reasonable value.

filer_max_purge_ops will still work when _do_purge_range, so it's ok to ignore it here.

Fixes: https://tracker.ceph.com/issues/58008
Signed-off-by: haoyixing <haoyixing@kuaishou.com>
src/mds/PurgeQueue.cc