Skip to content

Sol/Fable Review of codebase.#3

Open
jeregrine wants to merge 12 commits into
mainfrom
js-review-fixes
Open

Sol/Fable Review of codebase.#3
jeregrine wants to merge 12 commits into
mainfrom
js-review-fixes

Conversation

@jeregrine

@jeregrine jeregrine commented Jul 15, 2026

Copy link
Copy Markdown
Member

Each commit is a single thing it found, ordered by priority so its best to click a commit read-through it yourself. We can always drop a commit if it doesn't fit with the intent of the group project.

https://gist.github.com/jeregrine/c50404bc9317ca08f6cebd0b32381c07 for original finding

Cluster membership was written to two public ETS tables by multiple
shards and API callers. Interleaved add, remove, and purge operations
could leave a one-sided row and keep a dead node in routing state.

Route membership mutations through the Data owner and make purge scan
the forward index so it also repairs existing orphaned rows.
@jeregrine jeregrine changed the title Codex/Fable Review of codebase. Sol/Fable Review of codebase. Jul 15, 2026
jeregrine added 11 commits July 15, 2026 13:31
A local disconnect removed only locally owned rows, leaving remote
registry and group entries behind. Deletes missed while disconnected
could then survive the additive reconnect merge forever.

Discard the complete local view of each departed cluster and release
monitors for removed local entries. Validate that connect and
disconnect receive binary cluster names so the nil default cluster can
never be targeted by the full purge.
A replication batch already queued behind a local disconnect could repopulate the cluster after its entries were purged. Check named-cluster membership when buffered operations are applied so disconnected clusters cannot accept late registry or group writes.
Loser termination lived inside the default resolver, so custom
resolvers converged the registry while leaving the losing process
alive. Apply termination after either resolver chooses a winner and
use the winner's metadata consistently in the exit reason.

Document the behavior change in the changelog: resolvers that expect
the losing process to keep running must now handle its termination.
Disconnect waited on each shard before sending to the next, so one timeout left later shards untouched after cluster membership was already removed. Start every local request first, then await replies with alias cleanup so all shards receive the purge even when one call times out.
Process-DOWN replication and dispatch still used ordinary remote sends, allowing a busy distribution channel to suspend a replica shard or application caller and to initiate unwanted connections. Route both paths through send_nosuspend with noconnect and the existing reconnect policy.
Configured one-argument extractors were documented but silently
treated as identity functions, exposing unfiltered metadata on reads
and lifecycle events. Recognize function extractors in both public
read and replica event paths, and reject invalid extractor shapes at
startup so a misconfigured callback cannot silently fall back to
identity.
lookup rescued every ArgumentError, including failures raised by user extraction callbacks, and returned nil as if the key were absent. Limit recovery to the ETS access used for stopped instances so callback errors remain visible.
Zero and negative shard counts created descending ranges and supervisors that only failed later during routing. Apply the existing positive-integer check before configuration is stored or children are built.
TTL activity checks counted every matching registry or group row even though the sweeper needs only a boolean. Use limited ETS selects so each shard stops after the first match and later shards remain short-circuited.
Exact group keys are deterministically routed, but both count APIs scanned every shard. Compute the owning shard in the public API and query only that table while retaining all-shard scans for prefixes.
Public and internal docs still described DurableServer locking,
built-in process groups, old logging behavior, and outdated
replication paths. Make README and CLAUDE.md authoritative and drop
the unused callbacks config entry. The _archdoc reference blocks in
Replica, Data, and ClusterLease are kept in place.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant