-
Notifications
You must be signed in to change notification settings - Fork 151
K8SPSMDB-1308: Improve physical restore logs #1915
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
Open
egegunes
wants to merge
15
commits into
main
Choose a base branch
from
K8SPSMDB-1308
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+63
−7
Open
Changes from 3 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
4a78843
K8SPSMDB-1308: Improve physical restore logs
egegunes b3c332a
Merge branch 'main' into K8SPSMDB-1308
egegunes 5b8fc35
Merge branch 'main' into K8SPSMDB-1308
hors 7e5f36c
K8SPSMDB-1265: Update versions for 1.20.0 release (#1903)
jvpasinatto bda4499
Update Mongo 8 image to 8.0.8-3
jvpasinatto 18ac3ff
Fix compare files with correct PBM_MONGODB_URI (#1905)
jvpasinatto 82ae079
K8SPSMDB-1265: update oc compare for rs-shard-migration (#1909)
eleo007 b560d47
K8SPSMDB-1265: clean up basmdb-backup and use kubectl wait for wait_r…
eleo007 12b82d9
Revert to use Mongo 7 as default
jvpasinatto fcb2317
Print operator version (#1921)
eleo007 f949d5e
fix one-pod on azure
egegunes cda1ed4
fix balancer on aks
egegunes ac3cc14
K8SPSMDB-1268 pmm3 support (#1916)
gkech 4f7ca43
K8SPSMDB-1216 update to db.hello (#1929)
nmarukovich 2d82912
Merge branch 'main' into K8SPSMDB-1308
egegunes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,36 @@ | ||
#!/bin/bash | ||
|
||
set -Eeuo pipefail | ||
set -e | ||
set -o xtrace | ||
|
||
log=/tmp/pbm-agent.log | ||
PBM_AGENT_LOG=/tmp/pbm-agent.log | ||
MONGOD_LOG=/tmp/mongod.log | ||
PHYSICAL_RESTORE_DIR=/data/db/pbm-restore-logs | ||
|
||
function handle_sigterm() { | ||
echo "Received SIGTERM, cleaning up..." | ||
|
||
mkdir ${PHYSICAL_RESTORE_DIR} | ||
mv pbm.restore.log.* ${PBM_AGENT_LOG} ${MONGOD_LOG} ${PHYSICAL_RESTORE_DIR}/ | ||
|
||
echo "Restore finished, you can find logs in ${PHYSICAL_RESTORE_DIR}" | ||
exit 0 | ||
} | ||
|
||
trap 'handle_sigterm' 15 | ||
|
||
touch /opt/percona/restore-in-progress | ||
|
||
/opt/percona/pbm-agent 1>&2 2>${log} & | ||
/opt/percona/ps-entry.sh "$@" 1>&2 2>/tmp/mongod.log | ||
/opt/percona/pbm-agent >${PBM_AGENT_LOG} 2>&1 & | ||
pbm_pid=$! | ||
|
||
/opt/percona/ps-entry.sh "$@" >${MONGOD_LOG} 2>&1 & | ||
mongod_pid=$! | ||
|
||
echo "Physical restore in progress" | ||
tail -n +1 -f ${log} | ||
sleep infinity | ||
set +o xtrace | ||
echo "Physical restore in progress... pbm-agent logs: ${PBM_AGENT_LOG} mongod logs: ${MONGOD_LOG}" | ||
echo "Script PID: $$, pbm-agent PID: $pbm_pid, mongod PID: $mongod_pid" | ||
while true; do | ||
echo "Still in progress at $(date)" | ||
sleep 10 | ||
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
[shfmt] reported by reviewdog 🐶