cabol / shards

Partitioned ETS tables for Erlang and Elixir

Home Page:https://hexdocs.pm/shards

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix `shards` to work well with `ordered_set` tables.

cabol opened this issue · comments

Currently, shards doesn't behaves well when tables are ordered_set type, because results are sorted per shards, but not at global level (across all configured shards). The same problem happens with shards_dist across different node.

NOTE: This might be tricky to solve.

There is a workaround for this issue, and it is when a new ordered_set is created, force the number of shards to one, so with a single shard it will behave as a normal ETS ordered_set. The downside is that we would lose all benefits of shards, in case of ordered_set wouldn't make any difference to ETS. But for now, this fix will keep the correct behaviour of ordered_set – a better solution might be implemented afterwards.