Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
docs(troubleshooting): tighten the pooler section (llms-full budget); regenerate llms (#6317 lane 2)
garrytanf4462a09a414
diff --git a/docs/guides/troubleshooting.md b/docs/guides/troubleshooting.mdindex 5a19dc685d..d2f4cc4de1 100644--- a/docs/guides/troubleshooting.md+++ b/docs/guides/troubleshooting.md@@ -111,7 +111,7 @@ Turning the `preparation_deadlines` switch off (`gbrain config set persistence.pA `drain_stalled` stop with `cause: owner_wedged_here` is the same situation seen from the sync CLI: a live owner on this host holds the head write past the ceiling or its heartbeat row reads wedged. Before the ceiling the stop is loop-safe (`next.safe_to_loop: true`, `retry_after_ms` set); past it the stop names the pid to restart. Reference: [drain stops](write-refusals.md#drain-stalled).-<a id="persistence-pooler-transaction-mode"></a>**Doctor warns `persistence_pooler_transaction_mode`, or a running claim's owner backend sits `active` in `ClientRead` while the claim renews?** The resident consumer's ordinary pool goes through a transaction-mode pooler (PgBouncer or Supavisor on port 6543; the engine marks that URL with `prepare: false`). Such a pooler assigns a server connection per transaction and can leave the client waiting for a reply that never arrives: `pg_stat_activity` shows the backend `active` with `wait_event = ClientRead` and an old transaction, the owner's phase deadline fires, but the awaited promise never settles, so the claim renews forever with nothing in flight. The same catch-up on the session-mode URL (port 5432) or the direct URL drains. `gbrain sources writer status --source <id> --json` (read-only) shows, per running claim, `claim.owner.backend[]`: the owner process's backends matched on the `application_name` every gbrain pool sets (`gbrain <kind>:<pid>:<nonce>`), each with its statement label (first keyword and table, never the text), `state`, `wait_event` and ages; `backend_visibility` is `session` when the mapping is exact and `pooled` when a transaction-mode pooler shares server connections, so some backends may carry another client's name. Fix: set `DATABASE_URL` for the processes that hold write claims (`gbrain serve`, `gbrain sync`, the jobs worker) to the session-mode pooler URL or the direct database URL on their supervisor and restart them; short-lived readers may stay on the pooler. Verify with `gbrain doctor --only persistence_pooler_transaction_mode --json`, then `gbrain sources writer movement <id>`.+<a id="persistence-pooler-transaction-mode"></a>**Doctor warns `persistence_pooler_transaction_mode`, or a running claim's owner backend sits `active` in `ClientRead` while the claim renews?** The resident consumer's ordinary pool goes through a transaction-mode pooler (PgBouncer or Supavisor on port 6543; the engine marks that URL with `prepare: false`). Such a pooler can leave the client waiting for a reply that never arrives (`pg_stat_activity`: backend `active`, `wait_event = ClientRead`, an old transaction); the phase deadline fires but the awaited promise never settles, so the claim renews with nothing in flight. The same catch-up on the session-mode URL (port 5432) or the direct URL drains. `gbrain sources writer status --source <id> --json` (read-only) shows, per running claim, `claim.owner.backend[]`: the owner process's backends matched on the `application_name` every gbrain pool sets (`gbrain <kind>:<pid>:<nonce>`), each with its statement label (never the text), `state`, `wait_event` and ages; `backend_visibility` is `session` when the mapping is exact, `pooled` when the pooler shares server connections. Fix: set `DATABASE_URL` for the processes that hold write claims (`gbrain serve`, `gbrain sync`, the jobs worker) to the session-mode pooler URL or the direct database URL on their supervisor and restart them; short-lived readers may stay on the pooler. Verify with `gbrain doctor --only persistence_pooler_transaction_mode --json`, then `gbrain sources writer movement <id>`.<a id="two-consumers-on-host"></a>**Doctor warns `two_consumers_on_host`?** Two resident gbrain processes on this host (`serve`, `sync`, `jobs`, `autopilot`, `mcp`) have each run a *full* persistence consumer for more than 30 s, so both claim writes on the same roots. One full consumer per host is a preference, not a fenced role: a `serve` always starts full; every other resident kind probes the `persistence_consumers` heartbeat table at start and on every tick and runs *waiter-only* (it submits and waits, claims nothing) while a live, full, not-wedged consumer of this host exists, promoting itself when that row lapses (60 s), reads wedged or stops being full. Two processes that start within one renewal of each other can both start full, and a sync CLI that took its consumer before the `serve` started keeps it for that run; doctor lists both until one exits. Rows younger than 30 s and short-lived kinds (`put`, `import`, `dream`, `cycle`, `sources`, `cli`) are listed, never warned. `gbrain sources writer status --json` shows them under `host.consumers` (read-only); let the shorter-lived process finish, or restart it so it defers. With `persistence.single_consumer` off (`gbrain config set persistence.single_consumer false`, or `GBRAIN_SINGLE_CONSUMER=0`) every process keeps its own consumer as before and the warning describes the configured behavior. `gbrain sync --no-delegate` keeps that one run's own consumer on either engine.diff --git a/llms-full.txt b/llms-full.txtindex d822c647ee..8119424dd5 100644--- a/llms-full.txt+++ b/llms-full.txt@@ -9518,7 +9518,7 @@ Turning the `preparation_deadlines` switch off (`gbrain config set persistence.pA `drain_stalled` stop with `cause: owner_wedged_here` is the same situation seen from the sync CLI: a live owner on this host holds the head write past the ceiling or its heartbeat row reads wedged. Before the ceiling the stop is loop-safe (`next.safe_to_loop: true`, `retry_after_ms` set); past it the stop names the pid to restart. Reference: [drain stops](write-refusals.md#drain-stalled).-<a id="persistence-pooler-transaction-mode"></a>**Doctor warns `persistence_pooler_transaction_mode`, or a running claim's owner backend sits `active` in `ClientRead` while the claim renews?** The resident consumer's ordinary pool goes through a transaction-mode pooler (PgBouncer or Supavisor on port 6543; the engine marks that URL with `prepare: false`). Such a pooler assigns a server connection per transaction and can leave the client waiting for a reply that never arrives: `pg_stat_activity` shows the backend `active` with `wait_event = ClientRead` and an old transaction, the owner's phase deadline fires, but the awaited promise never settles, so the claim renews forever with nothing in flight. The same catch-up on the session-mode URL (port 5432) or the direct URL drains. `gbrain sources writer status --source <id> --json` (read-only) shows, per running claim, `claim.owner.backend[]`: the owner process's backends matched on the `application_name` every gbrain pool sets (`gbrain <kind>:<pid>:<nonce>`), each with its statement label (first keyword and table, never the text), `state`, `wait_event` and ages; `backend_visibility` is `session` when the mapping is exact and `pooled` when a transaction-mode pooler shares server connections, so some backends may carry another client's name. Fix: set `DATABASE_URL` for the processes that hold write claims (`gbrain serve`, `gbrain sync`, the jobs worker) to the session-mode pooler URL or the direct database URL on their supervisor and restart them; short-lived readers may stay on the pooler. Verify with `gbrain doctor --only persistence_pooler_transaction_mode --json`, then `gbrain sources writer movement <id>`.+<a id="persistence-pooler-transaction-mode"></a>**Doctor warns `persistence_pooler_transaction_mode`, or a running claim's owner backend sits `active` in `ClientRead` while the claim renews?** The resident consumer's ordinary pool goes through a transaction-mode pooler (PgBouncer or Supavisor on port 6543; the engine marks that URL with `prepare: false`). Such a pooler can leave the client waiting for a reply that never arrives (`pg_stat_activity`: backend `active`, `wait_event = ClientRead`, an old transaction); the phase deadline fires but the awaited promise never settles, so the claim renews with nothing in flight. The same catch-up on the session-mode URL (port 5432) or the direct URL drains. `gbrain sources writer status --source <id> --json` (read-only) shows, per running claim, `claim.owner.backend[]`: the owner process's backends matched on the `application_name` every gbrain pool sets (`gbrain <kind>:<pid>:<nonce>`), each with its statement label (never the text), `state`, `wait_event` and ages; `backend_visibility` is `session` when the mapping is exact, `pooled` when the pooler shares server connections. Fix: set `DATABASE_URL` for the processes that hold write claims (`gbrain serve`, `gbrain sync`, the jobs worker) to the session-mode pooler URL or the direct database URL on their supervisor and restart them; short-lived readers may stay on the pooler. Verify with `gbrain doctor --only persistence_pooler_transaction_mode --json`, then `gbrain sources writer movement <id>`.<a id="two-consumers-on-host"></a>**Doctor warns `two_consumers_on_host`?** Two resident gbrain processes on this host (`serve`, `sync`, `jobs`, `autopilot`, `mcp`) have each run a *full* persistence consumer for more than 30 s, so both claim writes on the same roots. One full consumer per host is a preference, not a fenced role: a `serve` always starts full; every other resident kind probes the `persistence_consumers` heartbeat table at start and on every tick and runs *waiter-only* (it submits and waits, claims nothing) while a live, full, not-wedged consumer of this host exists, promoting itself when that row lapses (60 s), reads wedged or stops being full. Two processes that start within one renewal of each other can both start full, and a sync CLI that took its consumer before the `serve` started keeps it for that run; doctor lists both until one exits. Rows younger than 30 s and short-lived kinds (`put`, `import`, `dream`, `cycle`, `sources`, `cli`) are listed, never warned. `gbrain sources writer status --json` shows them under `host.consumers` (read-only); let the shorter-lived process finish, or restart it so it defers. With `persistence.single_consumer` off (`gbrain config set persistence.single_consumer false`, or `GBRAIN_SINGLE_CONSUMER=0`) every process keeps its own consumer as before and the warning describes the configured behavior. `gbrain sync --no-delegate` keeps that one run's own consumer on either engine.