mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-22 22:56:29 +00:00
Delete any replication slots copied by pg_rewind
If --force-rewind is used in conjunction with "repmgr node rejoin", any replication slots present on the source node will be copied too; it's essential to remove these to prevent stale slots being extant when the node starts up. We do this at file system level *before* the server starts to minimize the risk of any problems. Addresses GitHub #334
This commit is contained in:
@@ -311,6 +311,14 @@ create_pg_dir(char *path, bool force)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int
|
||||
rmdir_recursive(char *path)
|
||||
{
|
||||
return nftw(path, unlink_dir_callback, 64, FTW_DEPTH | FTW_PHYS);
|
||||
}
|
||||
|
||||
static int
|
||||
unlink_dir_callback(const char *fpath, const struct stat *sb, int typeflag, struct FTW *ftwbuf)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user