What was implemented\n\nAll stub/placeholder implementations in the cluster package have been replaced with working code.\n\n### cluster/shard.go\n- ConsistentHashPlacement.PlaceActor() - Now builds a consistent hash ring from available nodes and uses it for deterministic actor placement (was: simple hash modulo)\n- ConsistentHashPlacement.RebalanceShards() - Now computes an entirely new shard map redistributing all shards across nodes using consistent hashing (was: returned unchanged map)\n- deriveReplicaCount() - New helper to extract replication factor from existing shard assignments\n\n### cluster/manager.go\n- handleRebalanceRequest() - Leader computes new shard map via ConsistentHashPlacement.RebalanceShards(), applies it locally, and broadcasts to cluster (was: only logged)\n- handleMigrationRequest() - Parses ActorMigration payload, detects if actor is local and initiates export (was: only logged)\n- triggerShardRebalancing() - Now actually computes new shard map and broadcasts it (was: only logged)\n- broadcastShardMap() - New method to publish shard map updates to aether.cluster.shard_map NATS subject\n- handleShardMapUpdate() - New method to apply received shard maps (applies only newer versions, ignores stale)\n- handleClusterMessage() - Now routes shard_map messages to handleShardMapUpdate()\n\n### cluster/distributed.go\n- SendMessage() - Now determines target node via consistent hash ring, sends locally if actor is on this node, otherwise routes via NATS route_message (was: always delegated to local runtime)\n- routeMessageToNode() - New method to send messages to other nodes\n- handleClusterMessage() route_message case - Now checks IsLocalActor() before delivering, relays to correct node if actor lives elsewhere (was: always delivered locally)\n- handleRebalanceRequest() - Now applies new shard maps from leader with version comparison (was: empty)\n\n### cluster/shard_test.go\n- TestConsistentHashPlacement_RebalanceShards - Updated to test actual rebalancing behavior (new version, correct shard assignments) instead of testing stub behavior\n\n## Summary\n\n| Stub | Status |\n|------|--------|\n| ConsistentHashPlacement.PlaceActor() | ✅ Fixed |\n| ConsistentHashPlacement.RebalanceShards() | ✅ Implemented |\n| ClusterManager.handleRebalanceRequest() | ✅ Implemented |\n| ClusterManager.handleMigrationRequest() | ✅ Implemented |\n| ClusterManager.triggerShardRebalancing() | ✅ Implemented |\n| DistributedVM.SendMessage() | ✅ Implemented |\n| DistributedVM.handleRebalanceRequest() | ✅ Implemented |\n| route_message handler | ✅ Fixed |\n\nAll tests pass. Build succeeds.
## What was implemented\n\nAll stub/placeholder implementations in the cluster package have been replaced with working code.\n\n### cluster/shard.go\n- **ConsistentHashPlacement.PlaceActor()** - Now builds a consistent hash ring from available nodes and uses it for deterministic actor placement (was: simple hash modulo)\n- **ConsistentHashPlacement.RebalanceShards()** - Now computes an entirely new shard map redistributing all shards across nodes using consistent hashing (was: returned unchanged map)\n- **deriveReplicaCount()** - New helper to extract replication factor from existing shard assignments\n\n### cluster/manager.go\n- **handleRebalanceRequest()** - Leader computes new shard map via ConsistentHashPlacement.RebalanceShards(), applies it locally, and broadcasts to cluster (was: only logged)\n- **handleMigrationRequest()** - Parses ActorMigration payload, detects if actor is local and initiates export (was: only logged)\n- **triggerShardRebalancing()** - Now actually computes new shard map and broadcasts it (was: only logged)\n- **broadcastShardMap()** - New method to publish shard map updates to aether.cluster.shard_map NATS subject\n- **handleShardMapUpdate()** - New method to apply received shard maps (applies only newer versions, ignores stale)\n- handleClusterMessage() - Now routes shard_map messages to handleShardMapUpdate()\n\n### cluster/distributed.go\n- **SendMessage()** - Now determines target node via consistent hash ring, sends locally if actor is on this node, otherwise routes via NATS route_message (was: always delegated to local runtime)\n- **routeMessageToNode()** - New method to send messages to other nodes\n- **handleClusterMessage() route_message case** - Now checks IsLocalActor() before delivering, relays to correct node if actor lives elsewhere (was: always delivered locally)\n- **handleRebalanceRequest()** - Now applies new shard maps from leader with version comparison (was: empty)\n\n### cluster/shard_test.go\n- TestConsistentHashPlacement_RebalanceShards - Updated to test actual rebalancing behavior (new version, correct shard assignments) instead of testing stub behavior\n\n## Summary\n\n| Stub | Status |\n|------|--------|\n| ConsistentHashPlacement.PlaceActor() | ✅ Fixed |\n| ConsistentHashPlacement.RebalanceShards() | ✅ Implemented |\n| ClusterManager.handleRebalanceRequest() | ✅ Implemented |\n| ClusterManager.handleMigrationRequest() | ✅ Implemented |\n| ClusterManager.triggerShardRebalancing() | ✅ Implemented |\n| DistributedVM.SendMessage() | ✅ Implemented |\n| DistributedVM.handleRebalanceRequest() | ✅ Implemented |\n| route_message handler | ✅ Fixed |\n\nAll tests pass. Build succeeds.
- Fix ConsistentHashPlacement.PlaceActor() to use consistent hash ring
- Implement ConsistentHashPlacement.RebalanceShards() to redistribute shards
- Implement ClusterManager.handleRebalanceRequest() with actual rebalancing
- Implement ClusterManager.handleMigrationRequest() for actor state transfer
- Implement ClusterManager.triggerShardRebalancing() to compute and broadcast
- Implement DistributedVM.SendMessage() with cross-node NATS routing
- Implement DistributedVM.handleRebalanceRequest() to update shard map
- Fix route_message handler to check if actor is local before delivery
- Update ConsistentHashPlacement.RebalanceShards() test for new behavior
- Add handleShardMapUpdate() and broadcastShardMap() to ClusterManager
- Replace non-deterministic map range fallback with sorted node selection in PlaceActor and RebalanceShards
- Add Body field to MessagePayload to preserve message data during cross-node routing
- Forward actual message body in route_message handler instead of discarding it
- Add self-message guard to route_message handler to prevent loops
- Add nil guard for shardMap in handleRebalanceRequest
- Add self-message guard to handleRebalanceRequest in DistributedVM
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What was implemented\n\nAll stub/placeholder implementations in the cluster package have been replaced with working code.\n\n### cluster/shard.go\n- ConsistentHashPlacement.PlaceActor() - Now builds a consistent hash ring from available nodes and uses it for deterministic actor placement (was: simple hash modulo)\n- ConsistentHashPlacement.RebalanceShards() - Now computes an entirely new shard map redistributing all shards across nodes using consistent hashing (was: returned unchanged map)\n- deriveReplicaCount() - New helper to extract replication factor from existing shard assignments\n\n### cluster/manager.go\n- handleRebalanceRequest() - Leader computes new shard map via ConsistentHashPlacement.RebalanceShards(), applies it locally, and broadcasts to cluster (was: only logged)\n- handleMigrationRequest() - Parses ActorMigration payload, detects if actor is local and initiates export (was: only logged)\n- triggerShardRebalancing() - Now actually computes new shard map and broadcasts it (was: only logged)\n- broadcastShardMap() - New method to publish shard map updates to aether.cluster.shard_map NATS subject\n- handleShardMapUpdate() - New method to apply received shard maps (applies only newer versions, ignores stale)\n- handleClusterMessage() - Now routes shard_map messages to handleShardMapUpdate()\n\n### cluster/distributed.go\n- SendMessage() - Now determines target node via consistent hash ring, sends locally if actor is on this node, otherwise routes via NATS route_message (was: always delegated to local runtime)\n- routeMessageToNode() - New method to send messages to other nodes\n- handleClusterMessage() route_message case - Now checks IsLocalActor() before delivering, relays to correct node if actor lives elsewhere (was: always delivered locally)\n- handleRebalanceRequest() - Now applies new shard maps from leader with version comparison (was: empty)\n\n### cluster/shard_test.go\n- TestConsistentHashPlacement_RebalanceShards - Updated to test actual rebalancing behavior (new version, correct shard assignments) instead of testing stub behavior\n\n## Summary\n\n| Stub | Status |\n|------|--------|\n| ConsistentHashPlacement.PlaceActor() | ✅ Fixed |\n| ConsistentHashPlacement.RebalanceShards() | ✅ Implemented |\n| ClusterManager.handleRebalanceRequest() | ✅ Implemented |\n| ClusterManager.handleMigrationRequest() | ✅ Implemented |\n| ClusterManager.triggerShardRebalancing() | ✅ Implemented |\n| DistributedVM.SendMessage() | ✅ Implemented |\n| DistributedVM.handleRebalanceRequest() | ✅ Implemented |\n| route_message handler | ✅ Fixed |\n\nAll tests pass. Build succeeds.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.