-
Notifications
You must be signed in to change notification settings - Fork 142
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
Make a tempfile while backup is running #731
Conversation
5dbb23b
to
34ca7d6
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #731 +/- ##
==========================================
- Coverage 80.02% 79.73% -0.30%
==========================================
Files 52 52
Lines 4751 4796 +45
Branches 970 977 +7
==========================================
+ Hits 3802 3824 +22
- Misses 920 943 +23
Partials 29 29
|
f71fe2a
to
605a1a9
Compare
medusa/utils.py
Outdated
class MedusaTempFile(object): | ||
|
||
_tempfile = None | ||
_tempfile_path = '/tmp/medusa_backup_in_progress' |
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.
Todo: for better cross platform compatibility, could you use tempfile.gettempdir()
instead of hardcoding /tmp
?
medusa/utils.py
Outdated
|
||
def exists(self): | ||
if self._tempfile is not None: | ||
return pathlib.Path(self._tempfile_path).exists() |
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.
Todo: let's assume an exception could be thrown here. We should display a warning and return False
.
I don't know if it's related to changes in this PR but I'm seeing the following errors in the logs:
and:
|
Thanks for catching those, I've pushed a fix. |
Quality Gate passedIssues Measures |
Fixes k8ssandra/k8ssandra-operator#1256
Fixes k8ssandra/k8ssandra-operator#1255
This PR adds the feature of reloading Medusa's configuration when running within the k8ssandra-operator.
The implementation has two parts:
/tmp
to indicate a backup is running. This is easily detectable from a shell w/o invoking anything special (another Medusa instance included).medusa.ini
file for changes by recalculating its digest every 5 seconds. If the digest changes, it'll check for running backups. If there are none, it'll kill the Medusa's gRPC process and exit, thus killing the entire container.The k8ssandra-operator will then restart the container, which will bring in the updated config.
(The debian build is failing for a known reason that gets fixed in another PR).