Closed
Description
DbState is currently lost when the process stops. On restart, slatedb should be able to continue using the SSTs that were already persisted to object storage. To do so, we need a way to persist the DbState. Right now, the state is simple enough that we can re-assemble it by scanning the SST files in the object storage.
On startup we init DbState with mem_table and imm_memtables as empty. The l0: Vec<SsTableInfo>
can be recreated by scanning all SSTs in object storage, and loading their SsTableInfo from the object store using TableStore.open_sst
. The next_sst_id
can be inferred by calculating the max previous SST ID.