fleet-memory/hindsight-docs/docs/developer
Chris Bartholomew dffb87080f
fix(migrations): bypass PgBouncer for advisory locks via MIGRATION_DATABASE_URL (#726)
* fix(migrations): use HINDSIGHT_API_MIGRATION_DATABASE_URL when set

Session-level advisory locks are broken when the database URL goes
through PgBouncer in transaction mode: the backend connection is
returned to the pool on COMMIT, orphaning the lock, so multiple pods
can simultaneously run migrations for the same schema.

When HINDSIGHT_API_MIGRATION_DATABASE_URL is set, use it for both
the advisory lock connection and the Alembic run.  Callers should
point this at the direct PostgreSQL endpoint (bypassing the pooler)
so the session-level lock is held for the full migration duration.

* refactor(migrations): move MIGRATION_DATABASE_URL to standard config

Wire HINDSIGHT_API_MIGRATION_DATABASE_URL through HindsightConfig
instead of reading os.getenv() directly in migrations.py. Add the
field to the dataclass, from_env(), log_config(), all call sites,
.env.example, and the configuration docs page.

* fix: update test mocks for migration_database_url kwarg and regenerate docs skill

---------

Co-authored-by: Nicolò Boschi <boschi1997@gmail.com>
2026-03-27 16:01:38 +01:00
..
api feat(docs): Integrations Hub + unified page hero (#620) 2026-03-19 20:29:55 +01:00
admin-cli.md Fix run-db-migration for all-tenant upgrades (#530) 2026-03-10 10:10:03 +01:00
configuration.md fix(migrations): bypass PgBouncer for advisory locks via MIGRATION_DATABASE_URL (#726) 2026-03-27 16:01:38 +01:00
development.md rename to hindsight (#2) 2025-11-25 19:28:26 +01:00
extensions.md feat: introduce hindsight-api-slim and hindsight-all-slim packages (#560) 2026-03-13 13:50:03 +01:00
index.mdx feat(docs): Integrations Hub + unified page hero (#620) 2026-03-19 20:29:55 +01:00
installation.md docs: add supported platforms and Windows installation guide (#700) 2026-03-26 12:01:30 +01:00
mcp-server.md feat: expand MCP tool surface area with 18 new tools and enhanced parameters (#435) 2026-02-25 10:26:46 +01:00
models.mdx docs: add Volcano Engine as supported LLM provider (#715) 2026-03-26 18:21:34 +01:00
monitoring.md feat: add LiteLLM LLM provider for Bedrock and 100+ providers (#679) 2026-03-25 14:17:38 +01:00
multilingual.md chore: internal renames (#204) 2026-01-27 09:53:28 +01:00
observations.mdx feat: observation_scopes field to drive observations granularity (#447) 2026-02-28 10:46:21 +01:00
performance.md doc: changelog for 0.4.12 (#397) 2026-02-18 14:55:19 +01:00
rag-vs-hindsight.md doc: mental models (#199) 2026-01-26 14:27:08 +01:00
reflect.mdx feat: increase customization for reflect, retain and consolidation (#419) 2026-02-23 20:35:32 +01:00
retain.md docs: entities vs tags vs metadata (#466) 2026-03-02 14:47:40 +01:00
retrieval.md chore: internal renames (#204) 2026-01-27 09:53:28 +01:00
services.md doc: mental models (#199) 2026-01-26 14:27:08 +01:00
storage.md bump pg0 0.11.x and improve documentation (#33) 2025-12-16 13:33:01 +01:00