The title says it all. I have found this from 10 years ago saying that if database data is all in the same snapshot, then pg_start_backup()
isn't needed. PostgreSQL will start from the snapshot like after a typical crash.
But what if there isn't a single snapshot for the whole database? What if there are some tablespaces in other datasets and WAL is in its own dataset too? This way, snapshots could be out of sync by a very small period of time. Would this make necessary to run pg_start_backup()
to ensure no data corruption?
I have found this too from 8 years ago, by a guy testing exactly this, if PostgreSQL would start again, creating an intentional delay between WAL and data snapshots, but using virtual machine snapshot technology. So it seems that it can work, the question would be, will it always work?
In fact, going one step further, why would be pg_start_backup()
needed in any circumstance? Isn't WAL replay capable of fixing the internal inconsistencies of a non-instantaneous backup?
Best regards.