Skip to content

docs(migration): add blue-green embedding migration design document - #1822

Open
A0nameless0man wants to merge 1 commit into
volcengine:mainfrom
A0nameless0man:pr/migration-docs-design
Open

A0nameless0man wants to merge 1 commit into
volcengine:mainfrom
A0nameless0man:pr/migration-docs-design

Conversation

@A0nameless0man

@A0nameless0man A0nameless0man commented Apr 30, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adds the architecture specification document for blue-green embedding model migration. This is the first PR in a series implementing the migration framework proposed in #1523.

Related Issue

Type of Change

  • Documentation update

Changes Made

  • Added docs/design/embedding-blue-green-migration-design.md (700 lines)
  • Covers: architecture overview, 7-phase state machine, class dependency diagram, constraint checklist (C-1 to C-9), crash recovery flows, design decision records, multi-embedder configuration, REST API design, online read-write interception, CLI command design, risk analysis, test coverage requirements

Subsequent PRs

# Planned Changes
#1823 MigrationPhase enum, MigrationState dataclass, MigrationStateManager with atomic FileLock persistence, MigrationStateFile for permanent history, OpenVikingConfig.embeddings field with dimension mismatch hard-block
— DualWriteAdapter wrapping two CollectionAdapters — active-side mandatory write, standby best-effort (retry + counter), drop_collection safety constraint, RLock thread safety
— ReindexEngine with paginated URI scan, batch missing-URI filter, QueueFS-based dedup queue, Semaphore concurrency control, graceful cancel via asyncio.Event
— MigrationController 7-phase state machine orchestrator, per-phase rollback helpers, crash recovery with correct target embedder resolution
— Concurrency safety and edge case coverage tests
— REST API router — 9 endpoints at /api/v1/migration/* registered in FastAPI app (admin/root auth for mutations); 28 E2E HTTP tests
— User guides — step-by-step migration walkthrough in Chinese and English
— Construction-time DualWriteAdapter injection via VikingDBManager(shared_adapter=...), runtime replace_shared_adapter() interface, collection name consistency via active_collection in state file
— ov migration CLI commands — start, status, targets, build, switch, disable-dual-write, finish, abort, rollback

Additional Notes

  • This is the design document only. User guides are in the last PR. CLI commands are planned for the final PR.
  • Ordered first per the implementation plan — provides the architecture reference for all subsequent PRs.

Architecture overview, class dependency diagram, 7-phase state machine
sequence diagrams, constraint checklist (C-1 to C-9), crash recovery flows,
and design decision records for the embedding model migration framework.

Extracted from PR volcengine#1816 commit 231ff57.
@github-actions

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

1523 - Fully compliant

Compliant requirements:

  • Added design document covering architecture, state machine, API, CLI, etc.

5 - Not compliant

Non-compliant requirements:

This PR does not address codeql-action bump

6 - Not compliant

Non-compliant requirements:

This PR does not address build fix

⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
🏅 Score: 100
🧪 No relevant tests
🔒 No security concerns identified
✅ No TODO sections
🔀 No multiple PR themes
⚡ No major issues detected

@github-actions

Copy link
Copy Markdown
Contributor

PR Code Suggestions ✨

No code suggestions found for the PR.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant