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-1796 Implement support for general/slowquery logs and logrotation of text logs #329
Conversation
I might be misremembering—I thought we didn't want to enable slow query logs but we did want to rotate them if they were enabled (cc @delgod) |
Codecov Report
@@ Coverage Diff @@
## main #329 +/- ##
==========================================
- Coverage 64.04% 63.96% -0.09%
==========================================
Files 15 16 +1
Lines 2940 2997 +57
Branches 385 390 +5
==========================================
+ Hits 1883 1917 +34
- Misses 934 956 +22
- Partials 123 124 +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.
Left some non-blockers - want to see your opinion before approving
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.
nice work
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.
LGTM.
delete_file_or_directory_in_unit() could play us bad story... today it is in tests only, but tomorrow someone will use it in production. File removal "rm -f" and folder removal "rm -rf" have significantly different risks.
tests/integration/helpers.py
Outdated
boolean indicating success | ||
""" | ||
try: | ||
return_code, _, _ = await ops_test.juju("ssh", unit_name, "sudo", "rm", "-rf", path) |
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.
Does it worth to ensure path is not "/" or "."? Otherwise: sudo rm -rf /
In general I would separate file removal, and avoid recursive call in this case.
I prefer find /path/ -mindepth 1 -mtime +5 -delete
for the deep cleanup.
In this particular case, I would separate file and folder removal.
P.S. Better safe then sorry (c) this.
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.
ah, it would be terrible to have rm -rf
run by mistake. changed to using find
in a0052bf (with maxdepth=0
to match exact paths, and no mtime
as the files the test deletes will be recently created)
In my personal opinion:
in case of disagreement, the decision maker here is @taurus-forever |
a0052bf
My opinion:
Mohamed, let's agree to keep slow query log disabled for now, by default (at least until we provide configuration options to disable it => mysql tuning). Tnx! |
Issue
Solution
juju-run
in v2.9.X andjuju-exec
in >= v3.1.X) to execute theFLUSH
statement. This is because we would like to avoid keeping database credentials on the machine