How it works...
Do, or do not; there is no try. If the system outage is serious enough, we do not know the full extent of the damage to system files. If our database was not initialized with file checksums, it might be weeks before the corruptions make themselves known. If a crashed server takes over as a primary before that happens, these corruptions could eventually be replicated to other systems.
It's safer to simply start from scratch. Therefore, our first step is to erase the /db/pgdata directory itself. With no old files to lead Patroni astray, it will rebuild the data by invoking pg_basebackup and configuring the instance that we specified in /etc/patroni/stampede.yml. We can even watch this happen by following the logs.
This is what ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access