cloudnative-pg icon indicating copy to clipboard operation
cloudnative-pg copied to clipboard

Make sure the backup object store is empty when bootstrapping a new cluster

Open gbartolini opened this issue 4 years ago • 5 comments

When bootstrapping a new cluster from a recovery object store, and the target cluster has a backup object store configured, invoke barman-cloud-check-wal-archive to make sure that the destination backup object store is empty.

This prevents users from erroneously overwrite an existing object store. The same concept can be probably extended to any bootstrap phase.

gbartolini avatar Apr 27 '22 11:04 gbartolini

@gbartolini I found an issue, we can't check the "future" object store from the operator since we don't have the barman-cloud-check-wal-archive command, this can only run inside a cluster already created, meaning that we can check during the init job only, and that will create at least one pod, it's that solution ok with you? It's the only solution I can see by now since only those container will have the Barman tools we need.

sxd avatar Apr 27 '22 20:04 sxd

@gbartolini After talking with @mnencia I have a cleared idea and I'll be moving this soon

sxd avatar Apr 28 '22 15:04 sxd

I believe https://github.com/cloudnative-pg/cloudnative-pg/issues/62#issuecomment-1113878444 applies to this issue as well?

NiharDudam avatar May 01 '22 02:05 NiharDudam

Taking the issue back - I think I can add a quick E2E

jsilvela avatar May 04 '22 14:05 jsilvela

I have added an issue to add E2E tests for the new backup + restore scenarios. For the moment this PR could be tested manually. Moving to second review.

jsilvela avatar May 05 '22 10:05 jsilvela