fix(ds): Fixes related to the shards table

This commit is contained in:
ieQu1 2023-11-28 12:57:03 +01:00
parent 7161f9d181
commit 05e47254e2
1 changed files with 3 additions and 3 deletions

View File

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