]> git.hungrycats.org Git - bees/commit
extent scan: make sure we run every extent crawler once per transaction
authorZygo Blaxell <bees@furryterror.org>
Mon, 20 Jan 2025 02:13:21 +0000 (21:13 -0500)
committerZygo Blaxell <bees@furryterror.org>
Mon, 20 Jan 2025 03:19:42 +0000 (22:19 -0500)
commit5fe89d85c35ee788d9974a0442634f4be0ccd2e4
tree3afdeeae699d8a2c8f2d32e287a0a277fda25907
parenta2b3e1e0c28b707c98080211dee02137c1e60fb5
extent scan: make sure we run every extent crawler once per transaction

There's a pathological case where all of the extent scan crawlers except
one are at the end of a crawl cycle, but the one crawler that is still
running is keeping the Task queue full.  The result is that bees never
starts the other extent scan crawlers, because the queue is always
full at the instant a new transid triggers the start of a new scan.
That's bad because it will result in bees falling behind when new data
from the inactive size tiers appears.

To fix this, check for throttling _after_ creating at least one scan task
in each crawler.  That will keep the crawlers running, and possibly allow
them to claw back some space in the Task queue.  It slightly overcommits
the Task queue, so there will be a few more Tasks than nominally allowed.

Also (re)introduce some hysteresis in the queue size limit and reduce it
a little, so that bees isn't continually stopping and restarting crawls
every time one task is created or completed, and so that we stay under
the configured Task limit despite overcommitting.

Signed-off-by: Zygo Blaxell <bees@furryterror.org>
src/bees-roots.cc