Skip to content

Commit 13cee14

Browse files
egeguneshors
andauthored
K8SPSMDB-1339: Validate PiTR target before starting restore (#1908)
* K8SPSMDB-1339: Validate PiTR target before starting restore * add unit tests * fix golangci-lint * fix pitr test * idk what's going on with labels * address review comments * fix physical restore log collection in tests * fix pitr-physical * Explicitly step down after configuring replset for physical restore * improve multi-storage test * improve physical restores * fix compare files * fixes * show caller in diff errors * fix --------- Co-authored-by: Viacheslav Sarzhan <slava.sarzhan@percona.com>
1 parent 388aa92 commit 13cee14

File tree

44 files changed

+489
-135
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+489
-135
lines changed

build/physical-restore-ps-entry.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ if [[ -z ${PBM_AGENT_TLS_ENABLED} ]] || [[ ${PBM_AGENT_TLS_ENABLED} == "true" ]]
2828
fi
2929
fi
3030

31-
/opt/percona/pbm-agent >${PBM_AGENT_LOG} 2>&1 &
31+
PATH=${PATH}:/opt/percona /opt/percona/pbm-agent-entrypoint >${PBM_AGENT_LOG} 2>&1 &
3232
pbm_pid=$!
3333

3434
/opt/percona/ps-entry.sh "$@" >${MONGOD_LOG} 2>&1 &
@@ -39,5 +39,5 @@ echo "Physical restore in progress... pbm-agent logs: ${PBM_AGENT_LOG} mongod lo
3939
echo "Script PID: $$, pbm-agent PID: $pbm_pid, mongod PID: $mongod_pid"
4040
while true; do
4141
echo "Still in progress at $(date)"
42-
sleep 10
42+
sleep 120
4343
done

config/crd/bases/psmdb.percona.com_perconaservermongodbbackups.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ spec:
109109
lastTransition:
110110
format: date-time
111111
type: string
112+
lastWriteAt:
113+
format: date-time
114+
type: string
112115
latestRestorableTime:
113116
format: date-time
114117
type: string

config/crd/bases/psmdb.percona.com_perconaservermongodbrestores.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ spec:
7575
lastTransition:
7676
format: date-time
7777
type: string
78+
lastWriteAt:
79+
format: date-time
80+
type: string
7881
latestRestorableTime:
7982
format: date-time
8083
type: string

deploy/bundle.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ spec:
113113
lastTransition:
114114
format: date-time
115115
type: string
116+
lastWriteAt:
117+
format: date-time
118+
type: string
116119
latestRestorableTime:
117120
format: date-time
118121
type: string
@@ -274,6 +277,9 @@ spec:
274277
lastTransition:
275278
format: date-time
276279
type: string
280+
lastWriteAt:
281+
format: date-time
282+
type: string
277283
latestRestorableTime:
278284
format: date-time
279285
type: string

deploy/crd.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ spec:
113113
lastTransition:
114114
format: date-time
115115
type: string
116+
lastWriteAt:
117+
format: date-time
118+
type: string
116119
latestRestorableTime:
117120
format: date-time
118121
type: string
@@ -274,6 +277,9 @@ spec:
274277
lastTransition:
275278
format: date-time
276279
type: string
280+
lastWriteAt:
281+
format: date-time
282+
type: string
277283
latestRestorableTime:
278284
format: date-time
279285
type: string

deploy/cw-bundle.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ spec:
113113
lastTransition:
114114
format: date-time
115115
type: string
116+
lastWriteAt:
117+
format: date-time
118+
type: string
116119
latestRestorableTime:
117120
format: date-time
118121
type: string
@@ -274,6 +277,9 @@ spec:
274277
lastTransition:
275278
format: date-time
276279
type: string
280+
lastWriteAt:
281+
format: date-time
282+
type: string
277283
latestRestorableTime:
278284
format: date-time
279285
type: string

e2e-tests/demand-backup-incremental-sharded/compare/statefulset_some-name-rs0_restore_sharded-oc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ spec:
196196
- command:
197197
- bash
198198
- -c
199-
- install -D /usr/bin/pbm /opt/percona/pbm && install -D /usr/bin/pbm-agent /opt/percona/pbm-agent
199+
- install -D /usr/bin/pbm /opt/percona/pbm && install -D /usr/bin/pbm-agent /opt/percona/pbm-agent && install -D /usr/bin/pbm-agent-entrypoint /opt/percona/pbm-agent-entrypoint
200200
imagePullPolicy: Always
201201
name: pbm-init
202202
resources: {}

e2e-tests/demand-backup-incremental-sharded/compare/statefulset_some-name-rs0_restore_sharded.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ spec:
197197
- command:
198198
- bash
199199
- -c
200-
- install -D /usr/bin/pbm /opt/percona/pbm && install -D /usr/bin/pbm-agent /opt/percona/pbm-agent
200+
- install -D /usr/bin/pbm /opt/percona/pbm && install -D /usr/bin/pbm-agent /opt/percona/pbm-agent && install -D /usr/bin/pbm-agent-entrypoint /opt/percona/pbm-agent-entrypoint
201201
imagePullPolicy: Always
202202
name: pbm-init
203203
resources: {}

e2e-tests/demand-backup-incremental/compare/statefulset_some-name-rs0_restore-arbiter-nv-oc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ spec:
195195
- command:
196196
- bash
197197
- -c
198-
- install -D /usr/bin/pbm /opt/percona/pbm && install -D /usr/bin/pbm-agent /opt/percona/pbm-agent
198+
- install -D /usr/bin/pbm /opt/percona/pbm && install -D /usr/bin/pbm-agent /opt/percona/pbm-agent && install -D /usr/bin/pbm-agent-entrypoint /opt/percona/pbm-agent-entrypoint
199199
imagePullPolicy: Always
200200
name: pbm-init
201201
resources: {}

e2e-tests/demand-backup-incremental/compare/statefulset_some-name-rs0_restore-arbiter-nv.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ spec:
196196
- command:
197197
- bash
198198
- -c
199-
- install -D /usr/bin/pbm /opt/percona/pbm && install -D /usr/bin/pbm-agent /opt/percona/pbm-agent
199+
- install -D /usr/bin/pbm /opt/percona/pbm && install -D /usr/bin/pbm-agent /opt/percona/pbm-agent && install -D /usr/bin/pbm-agent-entrypoint /opt/percona/pbm-agent-entrypoint
200200
imagePullPolicy: Always
201201
name: pbm-init
202202
resources: {}

0 commit comments

Comments
 (0)