Skip to content

Alias-first architecture for zero-downtime rebuilds#149

Draft
kapral18 wants to merge 1 commit intoelastic:mainfrom
kapral18:alias-first-architecture
Draft

Alias-first architecture for zero-downtime rebuilds#149
kapral18 wants to merge 1 commit intoelastic:mainfrom
kapral18:alias-first-architecture

Conversation

@kapral18
Copy link
Collaborator

@kapral18 kapral18 commented Feb 16, 2026

Closes #132

Sibling PR (MCP server): elastic/semantic-code-search-mcp-server#39

Summary

  • Make the index name a stable alias.
  • On --clean, build new backing indices and atomically swap aliases (no downtime).
  • Store file-level metadata in <alias>_locations and keep chunk docs content-deduped.

Model (alias-first)

<alias>            (alias)  ->  <alias>-scsi-<id>              (backing chunk index)
<alias>_locations  (alias)  ->  <alias>-scsi-<id>_locations    (backing locations index)
<alias>_settings   (index)      (commit state + maintenance lock)

Clean rebuild flow

acquire lock  ->  index into new backing indices  ->  swap aliases  ->  (optional) delete old backing  ->  release lock

Test Plan

  • npm run lint (pass)
  • npm run build (pass)
  • npm run test:unit (pass)
  • npm run test:integration (pass)

- Create backing indices and atomically swap aliases on clean rebuilds
- Add per-alias maintenance lock in <alias>_settings
- Keep chunk docs content-deduped and store per-file locations in <alias>_locations

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

feat: implement alias-first architecture for zero-downtime reindexing

1 participant