···317317 %HybridKV{kv | deleted_forest: deleted_forest, flushed_version: version}
318318 end
319319320320+ @spec put_storage(t, binary, binary) :: :ok
321321+ def put_storage(%HybridKV{} = kv, key, value) when is_binary(key) and is_binary(value) do
322322+ kv.storage_module.put(kv.storage_kv, key, value)
323323+ end
324324+320325 @spec commit(t) :: :ok
321326 def commit(%HybridKV{} = kv) do
322327 kv.storage_module.commit(kv.storage_kv)
+6-2
lib/servers/storage.ex
···138138 end
139139 kv = HybridKV.new(path: path)
140140141141+ # We are reading from storage here no matter what so the read at version=1 is fine
142142+ startup_version = String.to_integer(HybridKV.get(kv, 1, special_prefix() <> "durable_version") || "0")
143143+141144 state = %State{
142145 id: id,
143146 cluster: cluster,
144147145148 started: false,
146146- data_version: 0,
147147- durable_version: 0,
149149+ data_version: startup_version,
150150+ durable_version: startup_version,
148151149152 peek_nonce: nil,
150153 peek_results: %{},
···336339337340 # Now that all shard clears are complete, we can flush the remaining versions
338341 HybridKV.flush(kv, flush_version)
342342+ HybridKV.put_storage(kv, special_prefix() <> "durable_version", Integer.to_string(flush_version))
339343 HybridKV.commit(kv)
340344341345 # Send pops to tlogs