-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DPE-4669] Test: Scale to zero units #509
base: main
Are you sure you want to change the base?
Conversation
cb77a05
to
95ed5b5
Compare
95ed5b5
to
1681d0f
Compare
Hi @BalabaDmitri ! |
86c8c58
to
a195d6a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, @BalabaDmitri!
connection_string: Database connection string | ||
""" | ||
with psycopg2.connect(connection_string) as connection: | ||
connection.autocommit = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is not needed when you have a read-only statement only.
logger.info("scaling to one unit") | ||
await scale_application(ops_test, app, 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great addition to the tests (I mean scaling from 0 to 1 unit and later from 1 to 3 units to ensure it works after this sequence of operations).
What I see missing is the previously checked situation, which scales from 0 to 3 units.
if self._patroni.cluster_system_id_mismatch(unit_name=self.unit.name): | ||
self.unit.status = BlockedStatus(THIRD_PARTY_STORAGE_MESSAGE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: this blocked status can only be resolved by removing the unit and fixing the storage.
If so, I think we can return directly without calling event.defer()
.
Issue #508
Solution
Test coverage of the following cases:
Implementation