Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commitlog: Move cycle/sync/flush logic to message loop
Makes all write/flush operations into messages processing controlled/serialized by a (secondary) task loop. Actual IO becomes serialized, and should be processed in the order we work through segments. This includes periodic sync, even though we probably want to nice it up a bit once replenish/new/delete moves as well. Should be cleaned up to handle close/terminate in yet a separate loop, as to not block active segment writes. This includes flushing a discarded segment. The places we actually need to wait for things, we use the waitable counters. Note that timed/batch cycle right now _issues_ the write/flush without actual waiting, the only delay is through actual serialization of operations and timeout is used for the full op-wait. In later stages we probably want to change it so messages are delayed in some cases, causing latencies, but limiting IO/disk usage.
- Loading branch information