Skip to content

fix: use named volumes for indexer and processor databases#224

Merged
sameh-farouk merged 1 commit into
masterfrom
master-cockroach-named-volume
Jun 3, 2026
Merged

fix: use named volumes for indexer and processor databases#224
sameh-farouk merged 1 commit into
masterfrom
master-cockroach-named-volume

Conversation

@sameh-farouk
Copy link
Copy Markdown
Member

Problem

Both compose stacks store database data on anonymous volumes:

  • indexer/docker-compose.yml: cockroachdb- /cockroach/cockroach-data
  • docker-compose.yml: db (postgres) → - /var/lib/postgresql/data

Anonymous volumes are bound to a specific container. A service rename or recreate (e.g. the recent dbcockroachdb rename in #218) orphans the old volume and brings the service up with empty data, forcing a full re-ingest (archive) or resync (processor).

Fix

Switch both databases to named volumes (cockroach-data, postgres-data) declared at the top level, so data persists across renames/recreations.

Validated with docker compose config (both stacks render valid; volumes resolve to indexer_cockroach-data / <project>_postgres-data).

Note: the first switch from anonymous→named won't auto-migrate existing data (different volume); it removes the footgun going forward. Existing archive data can be migrated manually or re-ingested.

🤖 Generated with Claude Code

Both compose stacks declared their database data on anonymous volumes
(cockroach `- /cockroach/cockroach-data`, postgres `- /var/lib/postgresql/data`).
Anonymous volumes are bound to a specific container, so a service rename or
recreate (e.g. the recent db -> cockroachdb rename) orphans the old volume and
starts with empty data — forcing a full re-ingest/resync.

Switch both to named volumes (cockroach-data, postgres-data) so database data
survives renames and recreations.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sameh-farouk sameh-farouk merged commit 5c1cf30 into master Jun 3, 2026
1 check passed
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