this repo has no description
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

Load durable version at storage startup

+14 -2
+5
lib/hybrid_kv.ex
··· 317 317 %HybridKV{kv | deleted_forest: deleted_forest, flushed_version: version} 318 318 end 319 319 320 + @spec put_storage(t, binary, binary) :: :ok 321 + def put_storage(%HybridKV{} = kv, key, value) when is_binary(key) and is_binary(value) do 322 + kv.storage_module.put(kv.storage_kv, key, value) 323 + end 324 + 320 325 @spec commit(t) :: :ok 321 326 def commit(%HybridKV{} = kv) do 322 327 kv.storage_module.commit(kv.storage_kv)
+6 -2
lib/servers/storage.ex
··· 138 138 end 139 139 kv = HybridKV.new(path: path) 140 140 141 + # We are reading from storage here no matter what so the read at version=1 is fine 142 + startup_version = String.to_integer(HybridKV.get(kv, 1, special_prefix() <> "durable_version") || "0") 143 + 141 144 state = %State{ 142 145 id: id, 143 146 cluster: cluster, 144 147 145 148 started: false, 146 - data_version: 0, 147 - durable_version: 0, 149 + data_version: startup_version, 150 + durable_version: startup_version, 148 151 149 152 peek_nonce: nil, 150 153 peek_results: %{}, ··· 336 339 337 340 # Now that all shard clears are complete, we can flush the remaining versions 338 341 HybridKV.flush(kv, flush_version) 342 + HybridKV.put_storage(kv, special_prefix() <> "durable_version", Integer.to_string(flush_version)) 339 343 HybridKV.commit(kv) 340 344 341 345 # Send pops to tlogs
+3
lib/utils.ex
··· 22 22 defmacro server_keys_prefix, do: "\xFF/sk/" 23 23 defmacro server_keys_end, do: "\xFF/sk0" 24 24 25 + defmacro special_prefix, do: "\xFF\xFF" 26 + defmacro special_end, do: "\xFF\xFF\xFF\xFF" 27 + 25 28 defmacro special_server_keys_prefix, do: "\xFF\xFF/sk/" 26 29 defmacro special_server_keys_end, do: "\xFF\xFF/sk0" 27 30