Skip to content

Add zero-downtime OpenSearch index deployments#1

Open
stevebauman wants to merge 3 commits into
masterfrom
agent/zero-downtime-index-deployments
Open

Add zero-downtime OpenSearch index deployments#1
stevebauman wants to merge 3 commits into
masterfrom
agent/zero-downtime-index-deployments

Conversation

@stevebauman

@stevebauman stevebauman commented Jul 12, 2026

Copy link
Copy Markdown
Member

What changed

  • Add a Deployer service for provisioning versioned candidates, explicitly beginning backfills, marking candidates ready, atomically moving aliases, rolling back, cancelling candidates, and retiring previous indexes.
  • Keep writes on the active alias while a candidate is provisioned, then include the candidate only after backfilling explicitly begins.
  • Add backfill, ready, cutover, rollback, cancel, retire, and status deployment commands.
  • Add typed deployment state and lifecycle transitions through Deployment and DeploymentStatus.
  • Persist deployment state in a configurable opensearch_deployments database table through DeploymentRepository.
  • Publish deployment configuration separately as opensearch-deployments.php.
  • Prevent reset and refresh commands from invalidating managed deployments, while allowing migrate:fresh to explicitly clear their records.
  • Document the application-managed backfill and dual-write workflow.

Why

Rebuilding an index currently requires dropping the live index and importing every searchable record again. That creates downtime or incomplete search results while the replacement index is populated.

This introduces the package-level lifecycle needed for blue-green index deployments. Applications can inspect a provisioned candidate before enabling concurrent writes, populate it while the current alias stays live, and atomically promote it only after validation. The previous physical index remains available for rollback until it is explicitly retired.

Developer impact

Applications can resolve Deployer from the container or use the deployment lifecycle commands to orchestrate their own backfill and validation process. Deployment state is durable, and interrupted alias cutovers or rollbacks can safely resume.

Existing applications are unaffected unless they opt into managed deployments. Publishing the package configuration now also publishes opensearch-deployments.php.

Validation

  • vendor/bin/pint src tests README.md
  • vendor/bin/pest --compact — 115 tests passed, 315 assertions
  • Syntax checks for every deployment command
  • git diff --check

@stevebauman stevebauman marked this pull request as ready for review July 12, 2026 17:25
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