Queue like disk backed WAL
Pronouced Quál
- from the german word for agony
- because it is.
uses the tokio types
uses async-std types
The basic concept is simple, qwal
supports exactly 4 operations:
Appends a new entry to the end of the queue, returning its index.
Reads the next index from the queue, returning the previous entry and its index if one exists, or none if the queue is empty.
Acknowledges processing of an entry, confirming it is enqueued.
Reverts back to the last acknowledged entry in the queue - will clear/drain any entry since that point.
Writes the data to disk and performs a fsync. Also a seek
might be executed if a pop
was
performed since the last push
.
Reads the data from disk. Also a seek
is performed if a push
since the alst reads
.
No disk operations are performed, ack
's are persisted either during a push
operation or
as part of the shutdown sequence.
qwal
provides all limits as soft limits, meaning they are considered reached after an operation
has exceeded them, and not before.
To allow easier reclamation of space the WAL is stored in multiple chunks. The chunk size
defines the limit. A chunk is considered full once a push
makes it exceed the chunk_size
The soft limit of of chunks that can be active and open at the same time. The WAL is considered full when
max_chunks
+ 1 would need to be created.