remove confirmed_flush and other crud
authorRobert Haas <rhaas@postgresql.org>
Tue, 28 Jan 2014 16:21:56 +0000 (11:21 -0500)
committerRobert Haas <rhaas@postgresql.org>
Tue, 28 Jan 2014 16:21:56 +0000 (11:21 -0500)
src/backend/replication/slot.c
src/backend/replication/walsender.c
src/include/replication/slot.h

index e741fd5dc93db3e9937c3af7605590c4c6ad8335..0a68dbd13671a12eed516311290976ee3d6ce60d 100644 (file)
@@ -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;
index 7c9dbd4374634a12b50c6089195e6519f5f8b602..794f5f15526d1d077dee31e0f1c785a200377447 100644 (file)
@@ -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);
 
        /*
index 1b4ccf6e8cca94ecab5da3cef0a1f5c2a54e918b..47132d8f52bd43b215ea53f69521575420c97485 100644 (file)
@@ -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;
 
 /*