Just before the last cache_rejoin ack being received the entire
subtree, together with the inode subtree root belongs to, were
trimmed the isolated_inodes list couldn't be correctly erased. We
should defer calling the trim() until the last cache_rejoin ack
being received.
Fixes: https://tracker.ceph.com/issues/62036
Signed-off-by: Xiubo Li <xiubli@redhat.com>
}
}
+bool MDCache::is_ready_to_trim_cache(void)
+{
+ // null rejoin_done means rejoin has finished and all the rejoin acks
+ // have been well received.
+ return is_open() && !rejoin_done;
+}
+
void MDCache::upkeep_main(void)
{
std::unique_lock lock(upkeep_mutex);
if (active_with_clients) {
trim_client_leases();
}
- if (is_open() || mds->is_standby_replay()) {
+ if (is_ready_to_trim_cache() || mds->is_standby_replay()) {
trim();
}
if (active_with_clients) {
void upkeep_main(void);
+ bool is_ready_to_trim_cache(void);
+
uint64_t cache_memory_limit;
double cache_reservation;
double cache_health_threshold;