Skip to content

Commit f68bee0

Browse files
docs: Add operational note and fix step description for rebuild-storage
Note that graph-node must be stopped before running the command, making explicit the single-operator assumption baked into the check-then-act flow. Also correct the DROP SCHEMA step description to remove the stale IF EXISTS qualifier.
1 parent 6d3de7e commit f68bee0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

docs/graphman.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,11 @@ The `chain rebuild-storage` command recovers from a situation where a chain's st
467467
(e.g. `chain42`) has been dropped or corrupted on the shard but the chain's metadata in
468468
`public.chains` still exists. This can happen after manual database operations or partial failures.
469469

470+
> **Operational requirement:** Stop graph-node before running this command. The command
471+
> checks schema presence and then acts on that snapshot in a single transaction. Running
472+
> it while graph-node is active risks a concurrent schema modification between the check
473+
> and the transaction, which will cause the command to fail with an error.
474+
470475
The command behaves differently depending on the state of the storage:
471476

472477
**Storage missing** (non-destructive): the command silently rebuilds the schema and resets
@@ -477,7 +482,7 @@ existing schema and rebuilding it from scratch. Use `--force` to skip the prompt
477482

478483
In both cases, the command performs the following steps in a single transaction:
479484

480-
1. Drops the existing storage schema if present (`DROP SCHEMA IF EXISTS ... CASCADE`).
485+
1. Drops the existing storage schema if present (`DROP SCHEMA ... CASCADE`).
481486
2. Upserts the chain's row in `ethereum_networks` on the shard: inserts if missing, or repairs
482487
identity metadata (`namespace`, `net_version`, `genesis_block_hash`) and resets head tracking
483488
columns (`head_block_hash`, `head_block_number`, `head_block_cursor`) to `NULL` if the row exists.

0 commit comments

Comments
 (0)