1
0
mirror of https://github.com/Zygo/bees.git synced 2025-05-17 21:35:45 +02:00

roots: add a TRACE for transid_max search and crawl_transid thread

Users are hitting an exception somewhere in crawl_transid on 0.6.3, which
forces bees to return back to the transid_max calculation over and over.
Also there are out-of-range transids.

Add some BEESTRACE so we can see what we were doing in the exception
handler.

Signed-off-by: Zygo Blaxell <bees@furryterror.org>
This commit is contained in:
Zygo Blaxell 2020-12-22 21:39:37 -05:00
parent 7283126e5c
commit 74d4a8fe01

View File

@ -223,6 +223,7 @@ BeesRoots::transid_max_nocache()
while (true) {
sk.nr_items = 1024;
BEESTRACE("transid_max search sk " << sk);
sk.do_ioctl(m_ctx->root_fd());
if (sk.m_result.empty()) {
@ -422,13 +423,15 @@ BeesRoots::crawl_thread()
BEESNOTE("tracking transid");
auto last_count = m_transid_re.count();
while (true) {
// Measure current transid
BEESTRACE("Measure current transid");
catch_all([&]() {
BEESTRACE("calling transid_max_nocache");
m_transid_re.update(transid_max_nocache());
});
// Make sure we have a full complement of crawlers
BEESTRACE("Make sure we have a full complement of crawlers");
catch_all([&]() {
BEESTRACE("calling insert_new_crawl");
insert_new_crawl();
});
@ -496,19 +499,24 @@ BeesRoots::insert_new_crawl()
unique_lock<mutex> lock(m_mutex);
set<uint64_t> excess_roots;
for (auto i : m_root_crawl_map) {
BEESTRACE("excess_roots.insert(" << i.first << ")");
excess_roots.insert(i.first);
}
lock.unlock();
while (new_bcs.m_root) {
BEESTRACE("excess_roots.erase(" << new_bcs.m_root << ")");
excess_roots.erase(new_bcs.m_root);
BEESTRACE("insert_root(" << new_bcs << ")");
insert_root(new_bcs);
BEESCOUNT(crawl_create);
BEESTRACE("next_root(" << new_bcs.m_root << ")");
new_bcs.m_root = next_root(new_bcs.m_root);
}
for (auto i : excess_roots) {
new_bcs.m_root = i;
BEESTRACE("crawl_state_erase(" << new_bcs << ")");
crawl_state_erase(new_bcs);
}
}