[ ] Writing to segment buffer and returning a handle that indicates when that position of commit log is durable
[ ] Flushing to a position.
[ ] Closing a commit log safely.
[ ] Flush semaphore for concurrency control.
[ ] Commit log replay
[ ] End-to-end tests: start commit log, write concurrently for 1 minute, with flushes happening etc., then collect all writes, close cleanly, replay and check that state in-memory is the same.
Done
[x] Flush queue
[x] Gate
[x] Cycling a buffer (writing part of segment to underlying file).
TODO
Done
Functions
[x] Commitlog#add
[x] SegmentManager#allocate_when_possible
[x] SegmentManager#active_segment
[x] SegmentManager#current_segment
[x] SegmentManager#new_segment
[x] SegmentManager#finish_and_get_new
[ ] SegmentManager#flush_segments
[ ] SegmentManager#do_pending_deletes
[ ] SegmentManager#acquire_zeroed_buffer
[x] Segment#replenish_reserve
[x] Segment#cycle
[x] Segment#do_flush
[x] Segment#new_buffer
[ ] Segment#batch_cycle
[ ] Segment#flush
[ ] Segment#sync
[ ] Segment#reset_sync_time