Make use of postgres --sync-safekeepers in tests and CLI.

Change control plane code to call `postgres --sync-safekeepers` before
compute node start when safekeepers are enabled. Now `pg create` will
create an empty data directory with the proper config file. Subsequent
`pg start` will run `sync-safekeepers` and will call basebackup with
the resulting LSN. Also change few tests to accommodate this new behavior.
This commit is contained in:
Stas Kelvich
2021-08-26 14:38:28 +03:00
committed by arssher
parent 2cf3a70be5
commit ed4eed0a19
5 changed files with 141 additions and 101 deletions

View File

@@ -218,11 +218,11 @@ pub const PGDATA_SUBDIRS: [&str; 22] = [
"pg_logical/mappings",
];
pub const PGDATA_SPECIAL_FILES: [&str; 4] = [
"pg_hba.conf",
"pg_ident.conf",
"postgresql.conf",
"postgresql.auto.conf",
];
// Don't include postgresql.conf as it is inconvenient on node start:
// we need postgresql.conf before basebackup to synchronize safekeepers
// so no point in overwriting it during backup restore. Rest of the files
// here are not needed before backup so it is okay to edit them after.
pub const PGDATA_SPECIAL_FILES: [&str; 3] =
["pg_hba.conf", "pg_ident.conf", "postgresql.auto.conf"];
pub static PG_HBA: &str = include_str!("../samples/pg_hba.conf");