aboutsummaryrefslogtreecommitdiff
path: root/src/bin/pg_rewind/filemap.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/pg_rewind/filemap.c')
-rw-r--r--src/bin/pg_rewind/filemap.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/bin/pg_rewind/filemap.c b/src/bin/pg_rewind/filemap.c
index 8f49d346528..4ad7b2f2074 100644
--- a/src/bin/pg_rewind/filemap.c
+++ b/src/bin/pg_rewind/filemap.c
@@ -30,7 +30,7 @@ static char *datasegpath(RelFileNode rnode, ForkNumber forknum,
static int path_cmp(const void *a, const void *b);
static int final_filemap_cmp(const void *a, const void *b);
static void filemap_list_to_array(filemap_t *map);
-static bool check_file_excluded(const char *path, const char *type);
+static bool check_file_excluded(const char *path, bool is_source);
/*
* The contents of these directories are removed or recreated during server
@@ -148,7 +148,7 @@ process_source_file(const char *path, file_type_t type, size_t newsize,
Assert(map->array == NULL);
/* ignore any path matching the exclusion filters */
- if (check_file_excluded(path, "source"))
+ if (check_file_excluded(path, true))
return;
/*
@@ -338,7 +338,7 @@ process_target_file(const char *path, file_type_t type, size_t oldsize,
* mandatory for target files, but this does not hurt and let's be
* consistent with the source processing.
*/
- if (check_file_excluded(path, "target"))
+ if (check_file_excluded(path, false))
return;
snprintf(localpath, sizeof(localpath), "%s/%s", datadir_target, path);
@@ -490,7 +490,7 @@ process_block_change(ForkNumber forknum, RelFileNode rnode, BlockNumber blkno)
* Is this the path of file that pg_rewind can skip copying?
*/
static bool
-check_file_excluded(const char *path, const char *type)
+check_file_excluded(const char *path, bool is_source)
{
char localpath[MAXPGPATH];
int excludeIdx;
@@ -506,8 +506,12 @@ check_file_excluded(const char *path, const char *type)
filename++;
if (strcmp(filename, excludeFiles[excludeIdx]) == 0)
{
- pg_log(PG_DEBUG, "entry \"%s\" excluded from %s file list\n",
- path, type);
+ if (is_source)
+ pg_log(PG_DEBUG, "entry \"%s\" excluded from source file list\n",
+ path);
+ else
+ pg_log(PG_DEBUG, "entry \"%s\" excluded from target file list\n",
+ path);
return true;
}
}
@@ -522,8 +526,12 @@ check_file_excluded(const char *path, const char *type)
excludeDirContents[excludeIdx]);
if (strstr(path, localpath) == path)
{
- pg_log(PG_DEBUG, "entry \"%s\" excluded from %s file list\n",
- path, type);
+ if (is_source)
+ pg_log(PG_DEBUG, "entry \"%s\" excluded from source file list\n",
+ path);
+ else
+ pg_log(PG_DEBUG, "entry \"%s\" excluded from target file list\n",
+ path);
return true;
}
}