Skip to main content
← Back to list
01Issue
BugShippedSwamp CLIPublic
Assigneesstack72

Relationships

#1883 serve: #2308 method-run push fails with namespace mismatch — grant create does not push until a reload

Opened by stack72 · 8/28/2026· Shipped 8/28/2026

Summary

swamp#2308 (closes swamp-club#1882) made HA grant replication work end to end via reloads — verified on release 20260828.000039.0-sha.a0a7df05: create on A → reload --server A pushes grant data to the shared datastore → reload --server B pulls it → B enforces A's grant. First time the full chain works.

But the immediate push after the mutation — the markDirty()+pushChanged() block #2308 added to handleModelMethodRun — always fails on a namespaced datastore:

Failed to push changes to remote datastore: 'Namespace mismatch: bound to "serve-uat-1787876961735-ef8d9f19" but called with undefined'

(warn on serve stderr; swallowed by the catch). So after swamp access grant create --server A, the bucket still contains zero grant keys — for 15+ s and beyond — until someone runs an explicit reload on A. Consequences:

  • The AccessDataPoller on peer instances has nothing to pull after a mutation: poller-based propagation never happens unless an operator reloads the mutating instance first.
  • Operators get eventual consistency only through the manual reload they were not supposed to need.

Steps to reproduce

2-instance token-mode cluster on a shared ministack namespace (swamp-uat withServeCluster):

swamp access grant create --subject user:member --allow run --on "workflow:*" --server <A> --token <admin-A>
# bucket: zero objects matching "grant" (checked at 0/5/10/15s)
# A stderr: Failed to push changes to remote datastore: 'Namespace mismatch: bound to "<ns>" but called with undefined'
swamp access reload --server <A> --token <admin-A>
# bucket: 15 grant objects appear (data--swamp--grant index + data files)
swamp access reload --server <B> --token <admin-B>
swamp workflow run single-step --server <B> --token <member-B>   # → succeeds

Root cause pointer

The new push blocks in src/serve/handlers/model_handlers.ts (both insertion sites from #2308) call ctx.syncService.markDirty() / pushChanged() without the bound namespace argument, while the serve sync service is namespace-bound. handleAccessReload's push (same PR) evidently passes the namespace correctly — the fix is to call the method-run pushes the same way. The local-CLI pushes added in access_grant.ts/access_group.ts are worth checking for the same gap.

Expected

grant create --server (and group mutations) push immediately, so a peer's AccessDataPoller propagates the change within one 30s cycle with no reload anywhere.

Environment

swamp 20260828.000039.0-sha.a0a7df05; 2-instance cluster, @swamp/s3-datastore on ministack, fresh namespace per run; macOS. swamp-uat tests/cli/serve/access/ha_test.ts now asserts the working reload chain and pins the missing immediate push as a characterization that flips when this is fixed.

02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED+ 1 MOREASSIGNED+ 2 MOREREVIEW+ 7 MOREPR_MERGED+ 2 MORESESSION_SUMMARIZED

Shipped

8/28/2026, 6:16:19 AM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack728/28/2026, 1:04:50 AM

Sign in to post a ripple.