pub const MAX_ARCHIVE_SESSIONS: usize = 4_096;Expand description
Most sessions Database::archive_windowed will run for one call (T1.1).
A limit exists because the session count is a function of transaction-time span divided by window, and both come from the caller — a one-second window over a decade of history is ten million actor turns, each opening a transaction and writing a horizon row. That is not a slow archive, it is a caller who meant something else.
4,096 is chosen against the operation it bounds rather than against a clock:
at the measured 26.8 ms for a session with work in it, a full run of this
many is about two minutes of background writing, and the whole point of
windowing is that those two minutes are interruptible. It is a refusal
rather than a clamp — see DbError::ArchiveWindow for why.