From: Robert Haas Date: Tue, 28 Jan 2014 16:21:56 +0000 (-0500) Subject: remove confirmed_flush and other crud X-Git-Url: http://waps.l3s.uni-hannover.de/gitweb/?a=commitdiff_plain;h=e4d3029680c4eb568e76a0d13d2d36f264d787cc;p=users%2Frhaas%2Fpostgres.git remove confirmed_flush and other crud --- diff --git a/src/backend/replication/slot.c b/src/backend/replication/slot.c index e741fd5dc9..0a68dbd136 100644 --- a/src/backend/replication/slot.c +++ b/src/backend/replication/slot.c @@ -252,7 +252,6 @@ ReplicationSlotCreate(const char *name, bool db_specific) 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 @@ -756,7 +755,6 @@ SaveSlotToPath(ReplicationSlot *slot, const char *dir) 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; @@ -945,7 +943,6 @@ RestoreSlotFromDisk(const char *name) 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; diff --git a/src/backend/replication/walsender.c b/src/backend/replication/walsender.c index 7c9dbd4374..794f5f1552 100644 --- a/src/backend/replication/walsender.c +++ b/src/backend/replication/walsender.c @@ -649,8 +649,6 @@ CreateReplicationSlot(CreateReplicationSlotCmd *cmd) { const char *slot_name; StringInfoData buf; - char xpos[MAXFNAMELEN]; - const char *snapshot_name = NULL; Assert(!MyReplicationSlot); @@ -663,12 +661,9 @@ CreateReplicationSlot(CreateReplicationSlotCmd *cmd) 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 */ @@ -679,33 +674,6 @@ CreateReplicationSlot(CreateReplicationSlotCmd *cmd) 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 */ @@ -716,28 +684,6 @@ CreateReplicationSlot(CreateReplicationSlotCmd *cmd) 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); /* diff --git a/src/include/replication/slot.h b/src/include/replication/slot.h index 1b4ccf6e8c..47132d8f52 100644 --- a/src/include/replication/slot.h +++ b/src/include/replication/slot.h @@ -56,13 +56,6 @@ typedef struct ReplicationSlot * ---- */ XLogRecPtr restart_decoding; - - /* - * Last location we know the client has confirmed to have safely received - * data to. No earlier data can be decoded after a restart/crash. - */ - XLogRecPtr confirmed_flush; - } ReplicationSlot; /*