mirror of
https://github.com/Zygo/bees.git
synced 2025-06-17 01:56:16 +02:00
roots: use RateEstimator as a transid_max cache and clean up logs
transid_max is now measured at a single point in the crawl_transid thread. Move the Crawl deferred logic into BeesRoots so it restarts all crawls when transid_max increases. Gets rid of some messy time arithmetic. Change name of Crawl thread to "crawl_master" in both thread name and log messages. Replace "Next transid" with "Crawl started". Signed-off-by: Zygo Blaxell <bees@furryterror.org>
This commit is contained in:
@ -494,6 +494,7 @@ class BeesCrawl {
|
||||
mutex m_mutex;
|
||||
set<BeesFileRange> m_extents;
|
||||
bool m_deferred = false;
|
||||
bool m_finished = false;
|
||||
|
||||
mutex m_state_mutex;
|
||||
BeesCrawlState m_state;
|
||||
@ -508,6 +509,7 @@ public:
|
||||
BeesFileRange pop_front();
|
||||
BeesCrawlState get_state();
|
||||
void set_state(const BeesCrawlState &bcs);
|
||||
void deferred(bool def_setting);
|
||||
};
|
||||
|
||||
class BeesRoots : public enable_shared_from_this<BeesRoots> {
|
||||
@ -529,6 +531,7 @@ class BeesRoots : public enable_shared_from_this<BeesRoots> {
|
||||
Fd open_root_ino_nocache(uint64_t root, uint64_t ino);
|
||||
uint64_t transid_min();
|
||||
uint64_t transid_max();
|
||||
uint64_t transid_max_nocache();
|
||||
void state_load();
|
||||
void state_save();
|
||||
void crawl_roots();
|
||||
|
Reference in New Issue
Block a user