summaryrefslogtreecommitdiff
path: root/src/backend/replication/logical/origin.c
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2024-08-30 15:25:12 +0900
committerMichael Paquier <michael@paquier.xyz>2024-08-30 15:25:12 +0900
commitc39afc38cfec7c34b883095062a89a63b221521a (patch)
tree1784942625e22136eaa9d22802fadc4d9561d452 /src/backend/replication/logical/origin.c
parent2065ddf5e34ce098f549c4279ee3ab33c188a764 (diff)
Define PG_LOGICAL_DIR for path pg_logical/ in data folder
This is similar to 2065ddf5e34c, but this time for pg_logical/ itself and its contents, like the paths for snapshots, mappings or origin checkpoints. Author: Bertrand Drouvot Reviewed-by: Ashutosh Bapat, Yugo Nagata, Michael Paquier Discussion: https://postgr.es/m/ZryVvjqS9SnV1GPP@ip-10-97-1-34.eu-west-3.compute.internal
Diffstat (limited to 'src/backend/replication/logical/origin.c')
-rw-r--r--src/backend/replication/logical/origin.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/backend/replication/logical/origin.c b/src/backend/replication/logical/origin.c
index 419e4814f05..baf696d8e68 100644
--- a/src/backend/replication/logical/origin.c
+++ b/src/backend/replication/logical/origin.c
@@ -95,6 +95,10 @@
#include "utils/snapmgr.h"
#include "utils/syscache.h"
+/* paths for replication origin checkpoint files */
+#define PG_REPLORIGIN_CHECKPOINT_FILENAME PG_LOGICAL_DIR "/replorigin_checkpoint"
+#define PG_REPLORIGIN_CHECKPOINT_TMPFILE PG_REPLORIGIN_CHECKPOINT_FILENAME ".tmp"
+
/*
* Replay progress of a single remote node.
*/
@@ -572,8 +576,8 @@ ReplicationOriginShmemInit(void)
void
CheckPointReplicationOrigin(void)
{
- const char *tmppath = "pg_logical/replorigin_checkpoint.tmp";
- const char *path = "pg_logical/replorigin_checkpoint";
+ const char *tmppath = PG_REPLORIGIN_CHECKPOINT_TMPFILE;
+ const char *path = PG_REPLORIGIN_CHECKPOINT_FILENAME;
int tmpfd;
int i;
uint32 magic = REPLICATION_STATE_MAGIC;
@@ -698,7 +702,7 @@ CheckPointReplicationOrigin(void)
void
StartupReplicationOrigin(void)
{
- const char *path = "pg_logical/replorigin_checkpoint";
+ const char *path = PG_REPLORIGIN_CHECKPOINT_FILENAME;
int fd;
int readBytes;
uint32 magic = REPLICATION_STATE_MAGIC;