* FIXME: This might truncate the identifier if replication_name is
* somewhat longer...
*/
- snprintf(NameStr(*slot_name), NAMEDATALEN, "bdr_%u_%s_%u_%u__%s",
+ snprintf(NameStr(*slot_name), NAMEDATALEN, BDR_SLOT_NAME_FORMAT,
remote_dboid_i, local_sysid, ThisTimeLineID,
MyDatabaseId, NameStr(replication_name));
NameStr(*slot_name)[NAMEDATALEN - 1] = '\0';
* Build replication identifier.
*/
snprintf(remote_ident, remote_ident_length,
- "bdr_"UINT64_FORMAT"_%u_%u_%u_%s",
+ BDR_NODE_ID_FORMAT,
*remote_sysid_i, *remote_tlid_i, remote_dboid_i, MyDatabaseId,
NameStr(replication_name));
#include "utils/resowner.h"
#define BDR_VERSION_NUM 500
+#define BDR_SLOT_NAME_FORMAT "bdr_%u_%s_%u_%u__%s"
+#define BDR_NODE_ID_FORMAT "bdr_"UINT64_FORMAT"_%u_%u_%u_%s"
/*
* BdrApplyWorker describes a BDR worker connection.
ident = text_to_cstring(&node_class->riname);
- if (sscanf(ident, "bdr: "UINT64_FORMAT"-%u-%u-%u:%s",
+ if (sscanf(ident, BDR_NODE_ID_FORMAT,
&remote_sysid, &remote_tli, &remote_dboid, &local_dboid,
NameStr(replication_name)) != 4)
elog(ERROR, "could not parse sysid: %s", ident);