diff options
| author | Michael Paquier <michael@paquier.xyz> | 2025-10-23 15:57:46 +0900 |
|---|---|---|
| committer | Michael Paquier <michael@paquier.xyz> | 2025-10-23 15:57:46 +0900 |
| commit | 6ae08d9583e9a5e951286948bdd9fcd58e67718a (patch) | |
| tree | c0ae8f924e923da5d5cb4bb67109201006d0d957 /src/bin/pg_rewind/filemap.h | |
| parent | abc2b71383b4c49c2fbda74c281d50f3936551b8 (diff) | |
pg_rewind: Extend code detecting relation files to work with WAL files
isRelDataFile() is renamed to getFileContentType(), extended so as it
becomes able to detect more file patterns than only relation files. The
new file name pattern that can be detected is WAL files.
This refactoring has been suggested by Robert Haas. This will be used
in a follow-up patch where we are looking at improving how WAL files are
processed by pg_rewind. As of this change, WAL files are still handled
the same way as previously, always copied from the source to the target
server.
Extracted from a larger patch by the same authors.
Author: John Hsu <johnhyvr@gmail.com>
Author: Justin Kwan <justinpkwan@outlook.com>
Reviewed-by: Japin Li <japinli@hotmail.com>
Reviewed-by: Srinath Reddy Sadipiralla <srinath2133@gmail.com>
Discussion: https://postgr.es/m/181b4c6fa9c.b8b725681941212.7547232617810891479@viggy28.dev
Diffstat (limited to 'src/bin/pg_rewind/filemap.h')
| -rw-r--r-- | src/bin/pg_rewind/filemap.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/bin/pg_rewind/filemap.h b/src/bin/pg_rewind/filemap.h index df78a02e3da..fada420fc23 100644 --- a/src/bin/pg_rewind/filemap.h +++ b/src/bin/pg_rewind/filemap.h @@ -36,6 +36,13 @@ typedef enum FILE_TYPE_SYMLINK, } file_type_t; +typedef enum +{ + FILE_CONTENT_TYPE_OTHER = 0, + FILE_CONTENT_TYPE_RELATION, + FILE_CONTENT_TYPE_WAL +} file_content_type_t; + /* * For every file found in the local or remote system, we have a file entry * that contains information about the file on both systems. For relation @@ -51,7 +58,7 @@ typedef struct file_entry_t uint32 status; /* hash status */ const char *path; - bool isrelfile; /* is it a relation data file? */ + file_content_type_t content_type; /* * Status of the file in the target. |
