Skip to content

v0.5.0-beta

Latest

Choose a tag to compare

@alfetahe alfetahe released this 17 Feb 18:07

v0.5.0-beta - 2026-02-17

This release adds per-child metadata support, an experimental autonomous migration strategy, and major performance optimizations for large-scale operations.
It also includes a complete hook system overhaul with consistent naming and map-based data formats, a reimplemented HotSwap migration matching ColdSwap's pattern, and removal of the event queue locking mechanism.
Several race conditions and registry consistency bugs have been fixed, along with batched nodedown handling for rapid scale-down scenarios.

Added

  • Per-child metadata via :child_metadata option in start_children/3 — accepts %{child_id => metadata_map}, overrides global :metadata per child.
  • deterministic?/1 protocol function in Distribution.Base — indicates whether a strategy produces deterministic results based on topology alone (used to optimize child validation).
  • topology_signature/1 in Cluster — computes a hash of cluster topology for change detection.
  • Auto-calculated GenServer.call timeout for start_children/3 and stop_children/3: 5000ms + (1ms × child_count). Override with :call_timeout option.
  • :handover_delivered_hook — fires after HotSwap/ColdSwap migration completes state delivery.
  • ProcessHub.Strategy.Migration.Autonomous — experimental strategy where nodes independently reconcile local state against the distribution ring with no inter-node communication.

Performance

  • Batched belongs_to() calls in Replication.handle_post_start/3 — O(n) individual lookups reduced to a single batch operation.
  • Topology signature optimization skips redundant belongs_to() revalidation when topology hasn't changed. Applies to deterministic strategies only (ConsistentHashing, Guided).
  • belongs_to/4 now returns a Map instead of tuple list — O(1) lookups during redistribution.
  • Migration, redundancy, and cluster update handlers use Map-based child-to-node resolution.

Breaking changes

  • Removed event queue locking: lock_event_handler/2, unlock_event_handler/1, PriorityLevel, priority_state_updated hook, deadlock_recovery_timeout option. Use ProcessHub.is_partitioned?/1 for partition state. is_locked?/1 reimplemented as counter-based pending worker queue tracker.
  • Startup validation rejects handover (ColdSwap/HotSwap :handover) combined with Replication redundancy. Returns {:error, {:invalid_config, :handover_with_replication_not_supported}}.
  • belongs_to/4 must return %{child_id => [node()]} Map instead of [{child_id, [node()]}] list.
  • HotSwap migration reimplemented to match ColdSwap's pattern:
    • Removed: :retention, :confirm_handover, :handover_data_wait, :child_migration_timeout
    • Added: :state_ttl (30s default), :state_query_timeout (5s default)
    • ETS-based state storage; old process terminated immediately after delivery
    • New hotswap_handover_delivered hook
  • Renamed :children_migrated_hook:migration_handled_hook (signals handler completion, not full migration).
  • Hook system overhaul: All hook data dispatched as maps. Renames: pre/post_cluster_join/leave_hookpre/post_node_join/leave_hook, registry_pid_insert/remove_hookchild_registered/unregistered_hook, migration_handled_hookmigration_completed_hook, forwarded_migration_hookchildren_forwarded_hook, pre/post_nodes_redistribution_hookpre/post_redistribution_hook, child_process_pid_update_hookchild_pid_updated_hook. Removed: process_startups_hook (consolidated into post_children_start_hook). Added: scoreboard_updated_hook.

Fixed

  • HotSwap race condition: bulk_delete erased registry entries before gossip PidsRegisterRequest arrived. Entries now retained as TTL tombstones; gossip node-join sync calls detach_data for stale entries.
  • Replication start_replica_locally overwrote existing node-pid entries via insert instead of merging. Restructured into classify-then-execute pattern using bulk_insert.
  • Process registry writes now synchronous — all write/delete operations routed through GenServer to prevent concurrent interleaving.
  • Interval sync skips redundant registry updates when local PID already matches remote.
  • Batched nodedown handling for rapid node scale-down — multiple failures processed together via NodeDownBatch. Configurable window: :nodedown_batch_window_ms (default: 500ms).
  • Replaced OTP supervisor state introspection (elem/2 on internal record) with start-MFA proxy using process dictionary cache for OTP forward-compatibility.