Skip to content

Add atomic alias updates for zero-downtime index swaps#3

Merged
stevebauman merged 3 commits into
masterfrom
agent/add-atomic-alias-updates
Jul 12, 2026
Merged

Add atomic alias updates for zero-downtime index swaps#3
stevebauman merged 3 commits into
masterfrom
agent/add-atomic-alias-updates

Conversation

@stevebauman

Copy link
Copy Markdown
Member

Summary

  • add an AliasActions builder for atomic alias additions, removals, and index retirement
  • support is_write_index when creating and reading aliases
  • expose atomic alias updates through the index manager
  • make the fake index manager mirror alias replacement, deletion, and atomic update state
  • document the blue-green index swap API

Why

The adapter previously exposed only separate alias creation and deletion calls. Applications rebuilding a physical index could not atomically move a stable alias from the old index to the new one, creating a possible gap during a blue-green cutover.

This adds a first-party abstraction over OpenSearch's atomic aliases API so higher-level packages can safely coordinate zero-downtime index deployments.

Developer impact

Existing putAlias() and deleteAlias() usage remains unchanged. Consumers can now designate an alias write index and compose a complete cutover:

$actions = (new AliasActions)
    ->remove('posts_blue', 'posts')
    ->add('posts_green', new Alias('posts', isWriteIndex: true));

$indices->updateAliases($actions);

Adding updateAliases() to IndexManagerInterface means custom third-party implementations of that interface must implement the new method.

Validation

  • 168 unit tests passed with 283 assertions
  • 3 live OpenSearch integration tests passed with 17 assertions
  • Laravel Pint passed
  • git diff --check passed

@stevebauman stevebauman marked this pull request as ready for review July 12, 2026 16:53
@stevebauman stevebauman merged commit 215de1a into master Jul 12, 2026
6 checks passed
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