You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tg db migrate without the daemon: give other tg commands a turn #122
Since #121, tg db migrate pauses 150 ms after each batch of about 50 ms while the daemon runs, so a daemon write never waits longer than a batch. Without the daemon it runs batches back to back, as fast as it can. Another tg command that writes the same cache at that time (tg messages list caching a page, tg send caching the sent message) can still wait for the whole migration and fail with database is locked after its 5 s busy_timeout: on a 10M-message cache the migration takes minutes (docs/storage.md).
Proposed: without the daemon, pause once per second of work (about 15% more time), so any writer gets the lock within about a second. Measure the cost with bun run bench:storage --old-form.
Done when a test with a writer in another process and no daemon shows no refusal during a migration longer than its busy_timeout, and the docs give the cost. Related: #89, #121.
Activity
fix(db): give other tg commands a turn during tg db migrate alone
fix(db): give other tg commands a turn during tg db migrate alone