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

Redis integration. Do not use StoredState. #225

Conversation

javierdelapuente
Copy link
Contributor

@javierdelapuente javierdelapuente commented Apr 19, 2024

Overview

Related to #208 (failing S3 upload_assets). Also story ISD-1767.

When the Redis IP address changes, if discourse also restarts/upgrades, it can get into error state, and it will not advance.
The charm will be unable to migrate/upload to s3 or any other similar action in the workload, as the Redis IP address is wrong. The reason for the Redis IP address to be wrong is because it was stored previously in StoredState, being the correct one is in the relation data of the Redis integration.

The fix consists in not using StoredState and getting the IP address from the relation data.

Rationale

There is a fix that can get Discourse into error state, without any fix except changing the charm code manually (or undeploying the charm).

Juju Events Changes

Module Changes

Library Changes

Checklist

@javierdelapuente javierdelapuente changed the title Remove test that does not do what is says Redis integration. Do not use StoredState. Apr 19, 2024
@javierdelapuente javierdelapuente marked this pull request as ready for review April 19, 2024 12:50
@javierdelapuente javierdelapuente requested a review from a team as a code owner April 19, 2024 12:50
Copy link
Contributor

Test coverage for 5b9ebe8

Name              Stmts   Miss Branch BrPart  Cover   Missing
-------------------------------------------------------------
src/charm.py        336     32     80     13    89%   186, 194-195, 207, 335->343, 376->381, 393, 581-583, 588-589, 600-602, 607-608, 620-622, 627-628, 640-642, 667-669, 711->exit, 721->exit, 751-757, 783->exit, 797-798, 808->exit, 822
src/database.py      30      1      8      1    95%   56
-------------------------------------------------------------
TOTAL               366     33     88     14    90%

Static code analysis report

Run started:2024-04-19 12:50:21.788320

Test results:
  No issues identified.

Code scanned:
  Total lines of code: 1989
  Total lines skipped (#nosec): 3
  Total potential issues skipped due to specifically being disabled (e.g., #nosec BXXX): 0

Run metrics:
  Total issues (by severity):
  	Undefined: 0
  	Low: 0
  	Medium: 0
  	High: 0
  Total issues (by confidence):
  	Undefined: 0
  	Low: 0
  	Medium: 0
  	High: 0
Files skipped (0):

@javierdelapuente javierdelapuente merged commit 1bb5135 into main Apr 19, 2024
20 checks passed
@javierdelapuente javierdelapuente deleted the ISD-1767-Bug-On-redis-cluster-restart-redis-gets-an-ip-and-discourse-does-not-start branch April 19, 2024 14:49
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