INCIDENT: Fix migration crash — drop HNSW index before vector dimension ALTER #158
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo_admin/pal-e-api#158
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Lineage
plan-pal-e-docs→ Phase 5 (Activate Semantic Search) → Phase 5a (Dimension Fix) → INCIDENTRepo
forgejo_admin/pal-e-docsUser Story
As the platform
I need the API to stop crashing on startup
So that pal-e-docs is accessible again
Context
INCIDENT: API is in CrashLoopBackOff. Both pal-e-docs pods are crashing because the Alembic migration from PR #157 runs on startup and fails:
The
blocks.embeddingcolumn has an HNSW index, and HNSW has a hard 2000-dimension limit in pgvector. The migration tries to ALTER tovector(2560)without dropping the index first.File Targets
Files the agent should modify:
alembic/versions/o5j6k7l8m9n0_fix_embedding_vector_dimension.py— the migration that's crashing. Fix the upgrade() function to:DROP INDEX IF EXISTS ix_blocks_embedding(or whatever the index name is — check withSELECT indexname FROM pg_indexes WHERE tablename = 'blocks' AND indexdef LIKE '%vector%')ALTER TABLE blocks ALTER COLUMN embedding TYPE vector(2560)UPDATE blocks SET embedding_status = 'pending' WHERE embedding_status = 'error'(already exists)Files the agent should NOT touch:
src/pal_e_docs/models.py— already correct (Vector(2560))src/pal_e_docs/embedding_worker.py— already correctk8s/— deployment is fine, the migration is the problemAcceptance Criteria
Test Expectations
pytest tests/ -vConstraints
Checklist
Related
pal-e-docs— project this affects