NameStr(slot->name)[NAMEDATALEN - 1] = '\0';
slot->database = db_specific ? MyDatabaseId : InvalidOid;
slot->restart_decoding = InvalidXLogRecPtr;
- slot->confirmed_flush = InvalidXLogRecPtr;
/*
* Create the slot on disk. We haven't actually marked the slot allocated
strcpy(NameStr(cp.slot.name), NameStr(slot->name));
cp.slot.database = slot->database;
- cp.slot.confirmed_flush = slot->confirmed_flush;
cp.slot.restart_decoding = slot->restart_decoding;
cp.slot.in_use = slot->in_use;
cp.slot.active = false;
strcpy(NameStr(slot->name), NameStr(cp.slot.name));
slot->database = cp.slot.database;
slot->restart_decoding = cp.slot.restart_decoding;
- slot->confirmed_flush = cp.slot.confirmed_flush;
/* ignore previous values, they are transient */
slot->in_use = true;
slot->active = false;
{
const char *slot_name;
StringInfoData buf;
- char xpos[MAXFNAMELEN];
- const char *snapshot_name = NULL;
Assert(!MyReplicationSlot);
initStringInfo(&output_message);
slot_name = NameStr(MyReplicationSlot->name);
- snprintf(xpos, sizeof(xpos), "%X/%X",
- (uint32) (MyReplicationSlot->confirmed_flush >> 32),
- (uint32) MyReplicationSlot->confirmed_flush);
pq_beginmessage(&buf, 'T');
- pq_sendint(&buf, 4, 2); /* 4 fields */
+ pq_sendint(&buf, 1, 2); /* 1 field */
/* first field: slot name */
pq_sendstring(&buf, "replication_id"); /* col name */
pq_sendint(&buf, 0, 4); /* typmod */
pq_sendint(&buf, 0, 2); /* format code */
- /* second field: LSN at which we became consistent */
- pq_sendstring(&buf, "consistent_point"); /* col name */
- pq_sendint(&buf, 0, 4); /* table oid */
- pq_sendint(&buf, 0, 2); /* attnum */
- pq_sendint(&buf, TEXTOID, 4); /* type oid */
- pq_sendint(&buf, -1, 2); /* typlen */
- pq_sendint(&buf, 0, 4); /* typmod */
- pq_sendint(&buf, 0, 2); /* format code */
-
- /* third field: exported snapshot's name */
- pq_sendstring(&buf, "snapshot_name"); /* col name */
- pq_sendint(&buf, 0, 4); /* table oid */
- pq_sendint(&buf, 0, 2); /* attnum */
- pq_sendint(&buf, TEXTOID, 4); /* type oid */
- pq_sendint(&buf, -1, 2); /* typlen */
- pq_sendint(&buf, 0, 4); /* typmod */
- pq_sendint(&buf, 0, 2); /* format code */
-
- /* fourth field: output plugin */
- pq_sendstring(&buf, "plugin"); /* col name */
- pq_sendint(&buf, 0, 4); /* table oid */
- pq_sendint(&buf, 0, 2); /* attnum */
- pq_sendint(&buf, TEXTOID, 4); /* type oid */
- pq_sendint(&buf, -1, 2); /* typlen */
- pq_sendint(&buf, 0, 4); /* typmod */
- pq_sendint(&buf, 0, 2); /* format code */
-
pq_endmessage(&buf);
/* Send a DataRow message */
pq_sendint(&buf, strlen(slot_name), 4); /* col1 len */
pq_sendbytes(&buf, slot_name, strlen(slot_name));
- /* consistent wal location */
- pq_sendint(&buf, strlen(xpos), 4); /* col2 len */
- pq_sendbytes(&buf, xpos, strlen(xpos));
-
- /* snapshot name */
- if (snapshot_name != NULL)
- {
- pq_sendint(&buf, strlen(snapshot_name), 4); /* col3 len */
- pq_sendbytes(&buf, snapshot_name, strlen(snapshot_name));
- }
- else
- pq_sendint(&buf, -1, 4); /* col3 len, NULL */
-
- /* plugin */
- if (cmd->plugin != NULL)
- {
- pq_sendint(&buf, strlen(cmd->plugin), 4); /* col4 len */
- pq_sendbytes(&buf, cmd->plugin, strlen(cmd->plugin));
- }
- else
- pq_sendint(&buf, -1, 4); /* col4 len, NULL */
-
pq_endmessage(&buf);
/*