Operations¶
Scripts¶
All scripts are in src/data-graph/deploy/scripts.
| Script | Purpose |
|---|---|
build.sh |
Build the image |
up.sh |
Build and start. Needs GRAPHS |
down.sh |
Stop. Keeps data |
logs.sh |
Follow logs |
ctl.sh |
Run graphctl on the registry network |
test.sh |
Run static checks and all tests with the race detector |
purge.sh --yes |
Delete the database and the signing key |
Persistence and restarts¶
The database holds the last applied registry state and the bytes of its segments. After a restart the service verifies and loads them from disk, so it serves the last good state even when relays, indexers and origins are unreachable. Graphs are held in memory while serving, so size memory for the total of all loaded graphs. Segments that no applied state uses are deleted.
Backups¶
Back up graph.key: clients that pin the service key reject a service with another key. The database can be rebuilt from the registry. Deleting it also deletes the record of the last applied version, and with it the rollback protection for that graph.
Scaling and availability¶
Run as many graphd instances as you like with the same GRAPHS. They share nothing, load independently and report the same root for the same registry state. Each instance has its own signing key.
Monitoring¶
GET /healthzanswers when the process is serving.- Alert when a graph in
GET /v1/graphshas anerror, orloadedisfalse. - Compare
rootacross instances. Instances with the sameversionand different roots indicate a fault, or an intent that only one has seen so far.
Errors reported per graph¶
| Error | Cause | What to do |
|---|---|---|
registry was not found |
No manifest is known for the name | Check the author and name |
registry has conflicting manifests |
Two manifests with the same version | The author must resolve it. See Publishing |
registry was rolled back |
A lower version, or another manifest for the same version, was returned | Check the relays and indexers. The last good state stays in service |
... segment does not match its identifier |
The origin returned other bytes | Check the origin. It is retried on every synchronization |
... line N: ... |
A segment is invalid | Fix and publish it again |
graph is larger than the configured limit |
MAX_GRAPH_BYTES |
Raise the limit or split the graph |
origin answered 404 ... |
The bytes are missing | Upload again with registryctl publish |
assets listed in the manifest are missing |
Indexers and relays do not hold all asset events yet | Usually resolves itself |
Tests¶
test.sh covers the parser, the executor, the algorithms checked against brute force, inclusion proofs, and an end-to-end run with relays, indexers and the registryctl and graphctl programs: publishing, replacing, removing, revoking, tampered answers, corrupt origins, restarts and rollback attempts. internal/cypher also has a fuzz target, FuzzParse.