From ce0c1ab6298e039e518621500367d3586c86a1a0 Mon Sep 17 00:00:00 2001 From: Zygo Blaxell Date: Fri, 19 Oct 2018 02:09:09 -0400 Subject: [PATCH] roots: do not accept 18446744073709551615 as max_transid in beescrawl.dat Due to an earlier bug some beescrawl.dat files will contain uint64_t max as max_transid. This prevents any further scanning on the subvol because there is no possibiity of having a real transid (or any other uint64_t number) larger than uint64_t max. If we detect a bad transid in beescrawl.dat, log a warning, then use some more plausible value: either min_transid to repeat the previous incremental crawl, or 0 to restart the subvol scan from the beginning. Signed-off-by: Zygo Blaxell --- src/bees-roots.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/bees-roots.cc b/src/bees-roots.cc index cf28225..ed1dc8a 100644 --- a/src/bees-roots.cc +++ b/src/bees-roots.cc @@ -527,6 +527,16 @@ BeesRoots::state_load() loaded_state.m_started = d.at("started"); } BEESLOGDEBUG("loaded_state " << loaded_state); + if (loaded_state.m_min_transid == numeric_limits::max()) { + BEESLOGWARN("WARNING: root " << loaded_state.m_root << ": bad min_transid " << loaded_state.m_min_transid << ", resetting to 0"); + loaded_state.m_min_transid = 0; + BEESCOUNT(bug_bad_min_transid); + } + if (loaded_state.m_max_transid == numeric_limits::max()) { + BEESLOGWARN("WARNING: root " << loaded_state.m_root << ": bad max_transid " << loaded_state.m_max_transid << ", resetting to " << loaded_state.m_min_transid); + loaded_state.m_max_transid = loaded_state.m_min_transid; + BEESCOUNT(bug_bad_max_transid); + } insert_root(loaded_state); } }