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-4736] Improve async replication stability #526

Merged
merged 5 commits into from
Jul 5, 2024

Conversation

marceloneppel
Copy link
Member

@marceloneppel marceloneppel commented Jun 24, 2024

Issue

The async-replication tests sometimes fail due to the following issues:

  • Sometimes, peer data is no longer accessible at _on_async_relation_broken.
  • _on_async_relation_changed is sometimes executed just after the K8s pod is rescheduled, but the workload container is not accessible yet.
  • During a scale up operation, sometimes the new unit doesn't receive the relation joined event (only a relation created event + the relation changed event).

Solution

  • The cham checks if peer relation data is available at _on_async_relation_broken.
  • The async replication changed event is deferred if the workload container is not accessible yet.
  • Also, I created DPE-4737 for further investigation regarding the Juju relation created and joined events.
  • Added unit tests for the changes.

DPE-4833 was created for investigation and fixing of the remaining failures.

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Copy link

codecov bot commented Jun 24, 2024

Codecov Report

Attention: Patch coverage is 55.55556% with 4 lines in your changes missing coverage. Please review.

Project coverage is 70.83%. Comparing base (2827474) to head (af94eca).

Files Patch % Lines
src/relations/async_replication.py 55.55% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #526      +/-   ##
==========================================
+ Coverage   70.25%   70.83%   +0.57%     
==========================================
  Files          10       10              
  Lines        2797     2801       +4     
  Branches      521      522       +1     
==========================================
+ Hits         1965     1984      +19     
+ Misses        732      718      -14     
+ Partials      100       99       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@marceloneppel marceloneppel changed the title [DPE-4736] Stabilise async replication tests [DPE-4736] Improve async replication tests stability Jun 26, 2024
@marceloneppel marceloneppel changed the title [DPE-4736] Improve async replication tests stability [DPE-4736] Improve async replication stability Jun 26, 2024
…ync-replication-tests

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
@marceloneppel marceloneppel marked this pull request as ready for review July 4, 2024 15:24
Copy link
Member

@lucasgameiroborges lucasgameiroborges left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@marceloneppel marceloneppel merged commit e3e1533 into main Jul 5, 2024
72 checks passed
@marceloneppel marceloneppel deleted the dpe-4736-stabilise-async-replication-tests branch July 5, 2024 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants