https://slatedb.io logo
I am working on the next PR for https://github.com...
# general
v
I am working on the next PR for https://github.com/slatedb/slatedb/issues/53 . It involves i) Add a new snapshot ii) incrementing epoch iii) write empty wal to fence. Both manifest design and compaction design does not cover when a writer moves to a new manifest. It could be an implementation detail. In the PR that i am working on, I will need to remove the snapshot being used by writer. This would happen whenever the writer moves to a new snapshot (due to compaction) or when it closes. I am going to only do it on close for now, the snapshot will have infinite retention. This does have an issue, where the writer doesn't do a clean shutdown. To address it, we will need to add a snapshot refresh thread. Instead, we could do it in the same thread that looks for new manifest from compactor.
r
I was thinking it would make the most sense to, after initialization, write and read the manifest from the memtable flush thread. The memtable flush thread needs to write the manifest to commit l0 SSTs. It also needs to be able to resolve conflicts with the compactor writing the manifest. So it may as well own maintaining the writer's view of the manifest, and updating the manifest when needed. I think it will also be easier to reason about things if all manifest writes/reads (outside of initialization and maybe shutdown) are serialized on one thread.
v
After initialization, Doing it just in the flush thread would be simpler, yes!
r
yep, thats what I was thinking. Also to clarify - I think we should do this from the memtable flush thread, not the wal flush thread. I don't think the wal flush thread actually needs to touch the manifest right?