Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not load _everything_ in memory for bookkeeping (#189)
* create a new __corro_bookkeeping_gaps table containing needed version gaps, this should speed up boot time * possibly fix tests, using a large max seq was a bad idea * fix typo, get rid of process_version function * more typo fixes * fix test, painstakingly, forgot to allow sending partials * give CI a bit more time * use INNER JOIN for query instead of subquery * deadlock situation when trying to persist * fix warnings * send empties as empties, add a test for that * rename a field and add a few comments * actually persist as we go instead of once in a while, that was going to be a big problem * log how long it took to load bookkeeping, reduce default apply queue length to 200 * actually add tests and fix the gaps collection * add tests for initial gap being updated * maybe try collapsing ranges * for now, insert or ignore * I'm not sure if this is better * hold onto the lock between storing in db and in memory * may or may not be better, it should at least give consistent results * better diagnose locks held too long * revolution: process empties in hot path * process empties by switching a version's end_version to not-null * Revert "process empties by switching a version's end_version to not-null" This reverts commit 91e2689. * remove logic to process empties async, we don't do that anymore * log gaps in bookkeeping when failing to fully sync * site_id -> actor_id * sync a lot more often in test builds * count an empty version received as a change len of 1 instead of 0 * does that work * split in smaller chunks large empty version ranges * possibly much faster query to store empties * bring back huge empties handling * set len back to 0 when the changes are empty * timeout syncs after 5 minutes so we don't get stuck not processing any buffered changes * process changes in chunks based on 'cost' and not the number of changes (though that also informs it) * don't send partials that have the full range of versions * add command to lock the DB and run a command while it is locked * exit with the same code as the command * don't create the table if it exists, this is a special case... * much faster initial query to build small-but-still-here in-memory bookkeeping
- Loading branch information