From 7267707687d1afb61ae206779119714dc63cda5c Mon Sep 17 00:00:00 2001 From: Zygo Blaxell Date: Mon, 19 Dec 2022 00:19:18 -0500 Subject: [PATCH] roots: disable recent sorting by max_transid On large filesystems where the min_transid of all subvols gets stuck at 0, bees may lose the ability to effectively track recent data. A secondary sort by max_transid will allow scanning newer subvols that were created after bees started running on the filesystem, but before bees completed the first scan of all subvols. On the other hand, the secondary sort does a reverse version of the sequential scan mode, and the sequential scan mode is simply awful. Disable it for now. Signed-off-by: Zygo Blaxell --- src/bees-roots.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/bees-roots.cc b/src/bees-roots.cc index ce5afae..bcedc9e 100644 --- a/src/bees-roots.cc +++ b/src/bees-roots.cc @@ -323,7 +323,11 @@ BeesScanModeRecent::next_transid(const CrawlMap &crawl_map) if (this_range) { const auto state_end = this_crawl->get_state_end(); const auto min_transid = state_end.m_min_transid; - const auto max_transid = state_end.m_max_transid; + // Should we use max_transid or only min_transid? + // Using max_transid here would make it more like sequential, + // and sequential is bad. + // const auto max_transid = state_end.m_max_transid; + const auto max_transid = 0; const SortKey key { .min_transid = min_transid, .max_transid = max_transid }; sorted[key].push_back(this_crawl); }