From a115587fad8ae349d318ea781bf4e1b68be81851 Mon Sep 17 00:00:00 2001 From: Zygo Blaxell Date: Thu, 22 Dec 2022 00:12:10 -0500 Subject: [PATCH] roots: fix extent lock failure handling Drop the crawl_restart counter, it doesn't happen here (or anywhere else). Add the crawl_again counter for extents that are restarted due to an extent-level lock. Signed-off-by: Zygo Blaxell --- src/bees-roots.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/bees-roots.cc b/src/bees-roots.cc index a048968..5a29c5e 100644 --- a/src/bees-roots.cc +++ b/src/bees-roots.cc @@ -626,19 +626,17 @@ BeesFileCrawl::crawl_one_extent() // It might be corrupted data, the file might have been deleted or truncated, // or we might hit some other recoverable error. We'll try again with // the next extent. - bool scanned_ok = false; + bool scan_again = false; catch_all([&]() { BEESNOTE("scan_forward " << bfr); // BEESLOGDEBUG("scan_forward #" << Task::current_task().id() << " " << bfr); - scanned_ok = m_ctx->scan_forward(bfr); + scan_again = m_ctx->scan_forward(bfr); // BEESLOGDEBUG("done_forward #" << Task::current_task().id() << " " << bfr); } ); - if (scanned_ok) { + if (!scan_again) { m_hold = new_holder; } else { - BEESLOGDEBUG("retrying lock for extent at " << bfr); - BEESCOUNT(crawl_restart); - return true; + BEESCOUNT(crawl_again); } } } else {