Skip to content
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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

BalabaDmitri
Copy link
Contributor

Issue #508

Solution

Test coverage of the following cases:

  1. Scaling with and without storage.
  2. Whether writes are increasing.
  3. The shutdown of units after scale to zero.
  4. Scaling up to 1 unit uses PVC with the other cluster's storage.
  5. Remove the unit with another cluster's storage.
  6. Restore own hostpath in PVC.
  7. Scaling up to 1 and checking test data.
  8. Scaling up to 3 and checking test data.

Implementation

  1. Processing behaviour when using another cluster storage.

@lucasgameiroborges
Copy link
Member

Hi @BalabaDmitri !
Could you please fix the linting issues so we can see the integration test running on CI? Thanks!

Copy link
Member

@marceloneppel marceloneppel left a 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
Copy link
Member

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.

Comment on lines +493 to +494
logger.info("scaling to one unit")
await scale_application(ops_test, app, 1)
Copy link
Member

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.

Comment on lines +829 to +830
if self._patroni.cluster_system_id_mismatch(unit_name=self.unit.name):
self.unit.status = BlockedStatus(THIRD_PARTY_STORAGE_MESSAGE)
Copy link
Member

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().

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.

None yet

3 participants