fix: make create-replication action fail cleanly without async-replication relation#1676
Open
SAY-5 wants to merge 2 commits intocanonical:mainfrom
Open
fix: make create-replication action fail cleanly without async-replication relation#1676SAY-5 wants to merge 2 commits intocanonical:mainfrom
SAY-5 wants to merge 2 commits intocanonical:mainfrom
Conversation
…ation relation Signed-off-by: SAY-5 <saiasish.cnp@gmail.com>
taurus-forever
requested changes
May 5, 2026
Contributor
taurus-forever
left a comment
There was a problem hiding this comment.
Thank you for the contribution!
At least unit tests are unhappy here:
tests/unit/test_async_replication.py::test__configure_standby_cluster[True] FAILED
tests/unit/test_async_replication.py::test__configure_standby_cluster[False] FAILED
tests/unit/test_async_replication.py::test_handle_replication_change[True] FAILED
tests/unit/test_async_replication.py::test_handle_replication_change[False] FAILED
tests/unit/test_async_replication.py::test_handle_forceful_promotion[True] FAILED
tests/unit/test_async_replication.py::test_handle_forceful_promotion[False] FAILED
Please adopt. Please also sign commits and SLA agreement (new gmail email used?).
Signed-off-by: SAY-5 <saiasish.cnp@gmail.com>
Contributor
Author
|
Fixed — the regression test set |
Member
There was a problem hiding this comment.
Thanks for the fixes, @SAY-5! Did you check the CLA?
Contributor
Author
|
Yes — CLA signing is on my checklist. I'll get that signed shortly so this can land. |
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.
Issue
Closes #1675. Running
juju run postgresql/<unit> create-replication name=defaulton a unit with noasync-replicationrelation crashed withAttributeError: 'NoneType' object has no attribute 'name'because_on_create_replicationdereferencedself._relation.namebefore checking that the relation existed.Solution
Guard
self._relationforNoneand callevent.failwith a clear message instructing the operator to create the offer and relate the clusters first. Added a regression test exercising the missing-relation path.Checklist