feat: active-active HA mode using Redis lease - #6750
Open
sakkiii wants to merge 14 commits into
Open
Conversation
Signed-off-by: Saket Mittal <s@sakkiii.in>
Signed-off-by: Saket Mittal <s@sakkiii.in>
Signed-off-by: Saket Mittal <s@sakkiii.in>
Signed-off-by: Saket Mittal <s@sakkiii.in>
Signed-off-by: Saket Mittal <s@sakkiii.in>
Signed-off-by: Saket Mittal <s@sakkiii.in>
Signed-off-by: Saket Mittal <s@sakkiii.in>
Signed-off-by: Saket Mittal <s@sakkiii.in>
Signed-off-by: Saket Mittal <s@sakkiii.in>
Signed-off-by: Saket Mittal <s@sakkiii.in>
… ha-mode-with-redis
- Updated the project command runner to re-check ownership before cloning or merging the working directory, ensuring that a replica that lost its lease does not mutate the working directory. - Improved error handling during server shutdown to ensure all in-progress operations are drained properly, even if a shutdown error occurs. - Adjusted tests to reflect changes in ownership verification logic, ensuring that ownership loss is handled correctly before executing commands. Signed-off-by: Saket Mittal <s@sakkiii.in>
Updated the test for server shutdown behavior after HTTP timeout to ensure it completes all cleanup actions. The test now verifies that ownership release and database closure occur even when the HTTP shutdown deadline is missed, aligning with previous unconditional cleanup behavior. Signed-off-by: Saket Mittal <s@sakkiii.in>
sakkiii
force-pushed
the
ha-mode-with-redis
branch
from
August 14, 2026 11:12
bad8b0d to
9929149
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
what
Implements multi-replica active-active HA for Atlantis. Each PR is "owned" by one replica via a Redis lease. Webhooks arriving at a non-owning replica are forwarded over HTTP to the owner. Ownership renews every TTL/3 seconds. When a lease expires, another replica takes over.
Plan Storage Modes
Local Plans
Configuration:
.tfplanfiles only beneath the owner's data directory.External Plans
Configuration:
External storage does not remove the need for ownership. Ownership still provides pull request command ordering, stable local runtime state, forwarding, log locality, and cancellation affinity.
why
Implements multi-replica active-active HA for Atlantis. Each PR is "owned" by one replica via a Redis lease. Webhooks arriving at a non-owning replica are forwarded over HTTP to the owner. Ownership renews every TTL/3 seconds. When a lease expires, another replica takes over.
tests
references
closes #6751
closes #1571
Assisted-by: Claude