mds: do not call Journaler::_trim twice

Journaler::_trim is called in the routine:
PurgeQueue::_execute_item
==>Journaler::write_head
==>Journaler::_finish_write_head
==>Journaler::_trim
so do not register callback in PurgeQueue::_execute_item
to call Journaler::_trim again.

Signed-off-by: Tang Junhui <tangjunhui@sangfor.com>
Fixes: http://tracker.ceph.com/issues/37566
This commit is contained in:
Tang Junhui 2018-11-22 20:21:46 +08:00 committed by Junhui Tang
parent 578f7e082e
commit a509b5719b

View File

@ -519,9 +519,7 @@ void PurgeQueue::_execute_item(
// expire_pos doesn't fall too far behind our progress when consuming
// a very long queue.
if (in_flight.empty() || journaler.write_head_needed()) {
journaler.write_head(new FunctionContext([this](int r){
journaler.trim();
}));
journaler.write_head(nullptr);
}
}), &finisher));