mirror of
https://github.com/Zygo/bees.git
synced 2025-05-17 21:35:45 +02:00
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 <bees@furryterror.org>
This commit is contained in:
parent
90132182fd
commit
866a35c7fb
@ -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<uint64_t>::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<uint64_t>::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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user