Skip to content

Improve multi-platform detection of simultaneous ghe-backup runs#435

Merged
taz merged 1 commit into
masterfrom
taz/fix-simultaneous-ghe-backups
Sep 6, 2018
Merged

Improve multi-platform detection of simultaneous ghe-backup runs#435
taz merged 1 commit into
masterfrom
taz/fix-simultaneous-ghe-backups

Conversation

@taz

@taz taz commented Sep 6, 2018

Copy link
Copy Markdown
Member

This change corrects an issue where the PID provided by the in-progress file isn't correctly identified on Ubuntu systems. The ps -p PID command returns bash instead of ghe-backup, which results in the subsequent grep not returning a match.

After this change ghe-backup will stop if any process is found on the reported PID. As this could (rarely) result in false matches, a message has been added to warn the admin and recommend they examine the PID to see if it is indeed related and if not, remove the stale in-progress file.

False positives here should only occur if the in-progress file is left behind for some reason, and another process starts on the same PID that ghe-backup used in its previous run.

The message is similar to the one presented when a legacy in-progress symlink is detected.

/cc @github/backup-utils for review.

@taz taz self-assigned this Sep 6, 2018

@snh snh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For reference, we removed the use of -o to obtain the full command with arguments in #341 for portability reasons. This latest issue appears to be an unintended consequence due to another portability issue that was introduced as a result of #341.

I think the approach @taz is recommending is the safest from a portability point of view, and while there may be a small chance of false positives, this is countered by the fact this will result in less false negatives.

@lildude lildude left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seems like the best approach to take to stop chasing variations of ps output without going into the realms of trying to handle all scenarios. LGTM.

@taz taz merged commit 19fd6df into master Sep 6, 2018
@taz taz deleted the taz/fix-simultaneous-ghe-backups branch September 6, 2018 08:34
@lildude

lildude commented Sep 6, 2018

Copy link
Copy Markdown
Member

Just realised, this also addresses https://github.com/github/backup-utils/issues/184

This was referenced Sep 6, 2018
dooleydevin pushed a commit that referenced this pull request Aug 16, 2023
…s-translog-setting

Backport 378 for 3.8: Replace deprecated translog flush setting in ES
@dooleydevin dooleydevin mentioned this pull request Aug 16, 2023
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