Skip to content

fix(search): finish retirement and index maintenance on deploy - #8437

Merged
icecrasher321 merged 2 commits into
stagingfrom
codex/complete-search-embedding-retirement
Sep 29, 2026
Merged

icecrasher321 merged 2 commits into
stagingfrom
codex/complete-search-embedding-retirement

Conversation

@icecrasher321

Copy link
Copy Markdown
Collaborator

Summary

  • Finish legacy Search retirement in one deployment with 25,000-ID SQL pages, atomic cursor checkpoints, and bounded lock retries. Remove the one-minute/page-count deferral and pacing delay.
  • Follow deletion with a separately journaled concurrent rebuild of the vector projection's HNSW indexes and vacuum/analyze of the affected tables. Resume completed maintenance steps and recover invalid temporary indexes after interrupted rebuilds.
  • Preserve the selected cleanup scope, live Search configuration, and ordinary KB content. The deployment job keeps its existing five-hour timeout; index maintenance may dominate runtime.

Type of Change

  • Bug fix

Testing

  • All 114 database PostgreSQL/pgvector integration checks passed, including single-invocation completion, cascading deletes, scope isolation, rollback/resume, transient row locks, canceled concurrent index rebuilds, and maintenance checkpoints.
  • All 104 database unit tests, database type-check, lint, API validation, migration safety, docs manifest, and all 52 repository audits passed.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Sep 29, 2026 11:04pm UTC

Request Review

@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@greptile

@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@icecrasher321 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 5 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread packages/db/script-migrations/0028_maintain_search_retirement.ts
@greptile-apps

greptile-apps Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Critical risk] Database schema changes and migration ordering for search index retirement.

The PR appears safe to merge; no outstanding findings remain.

Summary

This PR completes Search embedding retirement in one migration run, then separately journals index rebuilding and vacuum maintenance.

  • Retirement uses larger, atomic SQL pages with bounded retries and resumable cursors.
  • Maintenance resumes from checkpoints and handles invalid indexes left by interrupted concurrent rebuilds.
  • The runbook now states the existing session-affine connection requirement for both entry points.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Migration runner] --> B[0027: retire Search content]
  B --> C[Checkpoint completed pages]
  C --> D[Record retirement receipt]
  D --> E[0028: rebuild HNSW indexes]
  E --> F[Vacuum and analyze tables]
  F --> G[Record maintenance receipt]
Loading

Reviews (2) · Last reviewed commit: "docs(search): clarify retirement migrati..."

Comment thread packages/db/script-migrations/0028_maintain_search_retirement.ts
@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@greptile

@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@icecrasher321 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 5 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@icecrasher321
icecrasher321 merged commit 158ead8 into staging Sep 29, 2026
32 checks passed
@icecrasher321
icecrasher321 deleted the codex/complete-search-embedding-retirement branch September 29, 2026 23:16

This branch was successfully deployed

1 active deployment
Preview — 87079ec8 Deployed Sep 29, 2026 by vercel[bot]
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