From ad41e448b9e0e8d7fbd6d605f3fd3231153b9079 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 12 Nov 2009 14:54:22 -0800 Subject: [PATCH] mds: recommit after commit if waiting for newer version If there are waiters for a later version of the dir to hit disk, then we need to recommit as soon as the prior commit completes. We auth_pin on adding the first waiter, and do not unpin until removing the last waiter, so this doesn't break auth_pin rules. Previously we could stall because we didn't finish the waiter (on the later version) but also never started the commit. Sometimes we would get lucky and someone else would ask for a commit, but sometimes not. We would then see old LogSegments that would never get fully expired. --- src/mds/CDir.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mds/CDir.cc b/src/mds/CDir.cc index 05ad08d255b50..bf42fbd6ee539 100644 --- a/src/mds/CDir.cc +++ b/src/mds/CDir.cc @@ -1699,7 +1699,11 @@ void CDir::_committed(version_t v, version_t lrv) while (p != waiting_for_commit.end()) { map >::iterator n = p; n++; - if (p->first > committed_version) break; // haven't committed this far yet. + if (p->first > committed_version) { + dout(10) << " there are waiters for " << p->first << ", committing again" << dendl; + _commit(p->first); + break; + } cache->mds->queue_waiters(p->second); waiting_for_commit.erase(p); p = n; -- 2.39.5