Merge pull request #12027 from ieQu1/dev/ds-meta-persist-shard

fix(ds): Persist shard table
This commit is contained in:
ieQu1 2023-11-28 14:33:57 +01:00 committed by GitHub
commit 8a065ba6d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -192,9 +192,9 @@ sites() ->
{ok, node()} | {error, no_leader_for_shard}.
shard_leader(DB, Shard) ->
case mnesia:dirty_read(?SHARD_TAB, {DB, Shard}) of
[#?SHARD_TAB{leader = Leader}] ->
[#?SHARD_TAB{leader = Leader}] when Leader =/= undefined ->
{ok, Leader};
[] ->
_ ->
{error, no_leader_for_shard}
end.
@ -314,7 +314,7 @@ ensure_tables() ->
{rlog_shard, ?SHARD},
{majority, Majority},
{type, ordered_set},
{storage, ram_copies},
{storage, disc_copies},
{record_name, ?SHARD_TAB},
{attributes, record_info(fields, ?SHARD_TAB)}
]),