infra: swap hobby PG to timescaledb-ha + bump CH max_concurrent_queries to 50 (HOL-35)#108
Merged
Merged
Conversation
…es to 50 (HOL-35) Two related infra tweaks surfaced during HOL-26 / HOL-29 prep work. ## TimescaleDB-HA replaces ankane/pgvector Hobby PG image swaps from ankane/pgvector:v0.5.1 to timescale/timescaledb-ha:pg16. The new image bundles: - TimescaleDB community 2.26.4 (Apache 2 base + Timescale License for some features; AGPL-compatible) - pgvector (replaces the existing ankane/pgvector role for embeddings) - timescaledb_toolkit - pg_partman is NOT in this image, but with TimescaleDB available we use drop_chunks for retention instead Volume layout note: timescaledb-ha lays its data dir at /home/postgres/pgdata/data, NOT the upstream /var/lib/postgresql/data. Updated the volume mount to match. Anyone swapping back to a different PG image needs to revert that path too — added a comment in compose.yml flagging this. Live-verified: TimescaleDB extension active, DevSeed populated 5 workspaces / 5 projects in the new image, HOL-26 PG migrations confirmed applicable. ## CH max_concurrent_queries 20 -> 50 HOL-24 set max_concurrent_queries=20 to constrain idle. Real workload exceeded it - even single SHOW CREATE TABLE queries got rejected with "Too many simultaneous queries" during HOL-29 schema-discovery work, because the backend's six worker hosted services keep CH busy with small queries continuously. 50 is still well below the default of 100 but accommodates the actual concurrency. Insert/select sub-caps bumped proportionally (10 -> 25 each). Live-verified: max_concurrent_queries reads 50 from the running CH container after recreate. ## Out of scope - Volume migration tooling for production deployments — the swap drops hobby dev data (DevSeed recreates it on first backend start). Real upgrades need a pg_dump/restore plan. Closes HOL-35. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two related infra tweaks surfaced during HOL-26 / HOL-29 prep work, plus a Dockerfile fix.
1. Hobby PG image:
ankane/pgvector→timescale/timescaledb-ha:pg16Hobby PG image swaps to bundle TimescaleDB + pgvector + timescaledb_toolkit. The new image enables hypertable partitioning +
drop_chunksretention for HOL-29's high-volume analytics tables (logs, traces, error_objects, sessions). Apache 2 base + Timescale License community features; AGPL-compatible.Volume layout note: timescaledb-ha lays its data dir at
/home/postgres/pgdata/data, NOT the upstream/var/lib/postgresql/data. Updated the volume mount to match. Anyone swapping back to a different PG image needs to revert that path too — flagged in compose.yml comment.One-time data wipe: the path change means existing dev volumes don't carry forward. DevSeed recreates 5 workspaces + 5 projects on first start (verified). Production deployments would need a
pg_dump/restoremigration plan.2. CH
max_concurrent_queries20 → 50HOL-24 set this to 20 to constrain idle. Real workload exceeded it — single
SHOW CREATE TABLEqueries got rejected with "Too many simultaneous queries" during HOL-29 schema-discovery, because the backend's six worker hosted services keep CH busy continuously. 50 is still well below the default of 100. Insert/select sub-caps bumped 10 → 25 each.3. Dockerfile fix (uncovered while live-testing the above)
backend-dotnet.Dockerfileonly had COPY directives for projects that existed before HOL-25/26. The newHoldFast.AnalyticsandHoldFast.Data.Postgresprojects were missing from the pre-restore COPY block, sodotnet restorecouldn't generate their assets files and the publish step failed. Added the two missing lines + a comment reminding future contributors to update this list when adding projects to the slnx.Acceptance verified live
docker compose up -dbrings up TimescaleDB-HA cleanly with the corrected volume mountAnalytics PG migration: applying 1 0001_create_analytics_schema.up.sql Analytics PG migration: applying 2 0002_create_schema_migrations.up.sql Analytics PG migration: applying 3 0003_install_extensions.up.sql Analytics PG migrations: 3 applied, 3 total, 0 already-appliedanalytics.schema_migrationspopulated with versions 1–3, alldirty=falsemax_concurrent_queriesreads 50 fromsystem.server_settings/health200; existing CH backend untouchedStats
4 files changed, +27 / -8.
Closes HOL-35.
🤖 Generated with Claude Code