Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
152455e
Implement partitioned grain registry for horizontal scaling
alejandro-miguez Aug 12, 2025
7e35ecc
Upgrade partisan to v5.0.3 version
alejandro-miguez Aug 19, 2025
21a0482
All these functions (on_merge/1, merge/2, is_stale/1, and sync/2) are…
alejandro-miguez Aug 20, 2025
cdbfb22
Each partition registers itself with a unique name: {erleans_registry…
alejandro-miguez Aug 20, 2025
02e1e7a
Each partition registers itself with a unique name: list_to_atom("erl…
alejandro-miguez Aug 20, 2025
b11be63
Fix an inconsistency error between the registry supervisor and partit…
alejandro-miguez Aug 20, 2025
146c09d
CRDT callbacks - All broadcast to all partitions for global coordination
alejandro-miguez Aug 20, 2025
afb4eea
Upgrade bondy_mst version supporting MFA config used in erleans_regis…
alejandro-miguez Aug 20, 2025
e9b4384
Fixes in bondy_mst_crdt & partisan_plumtree callbacks
alejandro-miguez Aug 20, 2025
bac55bd
Removing erleans_registry_partition from partisan broadcast_mods
alejandro-miguez Aug 20, 2025
63aac6c
Returning true as default in is_stale/2 plumtree_brodcast_handler cal…
alejandro-miguez Aug 20, 2025
ad88ad2
Merge branch 'feature/aramallo.mst' into feature/alejandro-miguez.erl…
alejandro-miguez Aug 20, 2025
8c62249
Added to be able to perform a GC in partition registry CRDT based on …
alejandro-miguez Aug 21, 2025
9b9ee65
Merge branch 'feature/alejandro-miguez.erleans_registry_partition' of…
alejandro-miguez Aug 21, 2025
1122164
Upgrade bondy_mst version using the feature of callback_args instead …
alejandro-miguez Aug 23, 2025
92a095a
Fix partisan dependency to https://github.com/lasp-lang/partisan.git …
alejandro-miguez Sep 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# CHANGELOG

---
## X.Y.Z (2025-08-12)
### CHANGES
- Implement partitioned grain registry for horizontal scaling

Refactor erleans_pm from single-server architecture to partitioned
registry system using gproc_pool for consistent grain distribution
across N partition workers, improving performance and scalability.

**Core Changes:**
- Split erleans_pm into router + partition architecture
- Create erleans_registry_partition: individual CRDT partition workers
- Create erleans_registry_sup: manages N partitions via gproc_pool
- Convert erleans_pm to router using consistent hashing for grain distribution

**Technical Implementation:**
- Use gproc_pool hash strategy for deterministic grain-to-partition routing
- Maintain same public API for backward compatibility
- Preserve all CRDT synchronization and conflict resolution logic
- Add configurable pm_partitions setting (default: 1, recommend: 4)

**Configuration & Dependencies:**
- Update startup order: erleans_config before erleans_registry_sup
- Add pm_partitions config to test environments
- Fix partisan peer service configuration in distributed tests
- Integrate with erleans_config API instead of direct application:get_env

**Testing & Validation:**
- Add comprehensive registry_partition_SUITE for partition verification
- Add partition_logic_test for gproc_pool behavior analysis
- Fix dist_lifecycle_SUITE startup issues with partisan configuration
- Preserve all existing test functionality through API compatibility

**Benefits:**
- Horizontal scaling: distribute grain load across multiple partitions
- Improved concurrency: reduce contention on single registry server
- Consistent routing: same grain always maps to same partition
- Backward compatible: existing code works without changes
3 changes: 2 additions & 1 deletion config/sys.config.src
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
%% -*- erlang -*-
[{erleans, [{providers, #{in_memory => #{module => erleans_provider_ets,
args => #{}}}},
{default_provider, in_memory}
{default_provider, in_memory},
{pm_partitions, 4}
]},

{partisan, [
Expand Down
4 changes: 2 additions & 2 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
resulto,
{partisan, {
git,
"http://github.com/lasp-lang/partisan.git",
"https://github.com/lasp-lang/partisan.git",
{tag, "v5.0.3"}
}},
{bondy_mst,{
git,
"https://github.com/bondy-io/bondy_mst.git",
{branch, "without-rocksdb"}
{branch, "feature/alejandro-miguez.add_mfa_support"}
}},
{types, "0.1.8"},
{sbroker, {
Expand Down
4 changes: 2 additions & 2 deletions rebar.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
1},
{<<"bondy_mst">>,
{git,"https://github.com/bondy-io/bondy_mst.git",
{ref,"4a0da7062ac8435a8e3f59d3d58c1e5476ec1ec6"}},
{ref,"3ff177084842bf01509e05442f505d218759b7e7"}},
0},
{<<"cf">>,{pkg,<<"cf">>,<<"0.3.1">>},1},
{<<"erlware_commons">>,{pkg,<<"erlware_commons">>,<<"1.8.1">>},0},
Expand All @@ -39,7 +39,7 @@
{ref,"41cb700d60a7dcfdb4165aca73634bbe1c07a33f"}},
0},
{<<"partisan">>,
{git,"http://github.com/lasp-lang/partisan.git",
{git,"https://github.com/lasp-lang/partisan.git",
{ref,"c5309d479b2beddfdd32f1c00338a8a771a745be"}},
0},
{<<"quickrand">>,{pkg,<<"quickrand">>,<<"2.0.7">>},1},
Expand Down
3 changes: 2 additions & 1 deletion src/erleans.app.src
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
{modules, []},
{env, [{deactivate_after, 2700000}, %% 45 minutes
{refresh_interval, 5000},
{num_partitions, 128}]},
{num_partitions, 128},
{pm_partitions, 4}]}, %% Number of registry partitions

{licenses, ["Apache 2"]},
{links, [{"GitHub", "https://github.com/erleans/erleans"}]}
Expand Down
2 changes: 1 addition & 1 deletion src/erleans_app.erl
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ setup_partisan() ->
Overrides = #{
broadcast_mods => ordsets:to_list(
ordsets:union(
ordsets:from_list([erleans_pm, partisan_plumtree_backend]),
ordsets:from_list([partisan_plumtree_backend]),
ordsets:from_list(BroadcastMods)
)
)
Expand Down
Loading