Remove unused latch
authorHeikki Linnakangas <[email protected]>
Sat, 5 Oct 2024 12:09:27 +0000 (15:09 +0300)
committerHeikki Linnakangas <[email protected]>
Sat, 5 Oct 2024 12:09:27 +0000 (15:09 +0300)
It was left unused by commit bc971f4025, which replaced the latch
usage with a condition variable

Discussion: https://www.postgresql.org/message-id/391abe21-413e-4d91-a650-b663af49500c@iki.fi

src/backend/replication/walsender.c
src/include/replication/walsender_private.h

index c5f1009f3706ed0153aba4d276af3d50a920e2f3..866b69ec8555c0942df32cb7fa3f284625807b5b 100644 (file)
@@ -2935,7 +2935,6 @@ InitWalSenderSlot(void)
            walsnd->flushLag = -1;
            walsnd->applyLag = -1;
            walsnd->sync_standby_priority = 0;
-           walsnd->latch = &MyProc->procLatch;
            walsnd->replyTime = 0;
 
            /*
@@ -2979,8 +2978,6 @@ WalSndKill(int code, Datum arg)
    MyWalSnd = NULL;
 
    SpinLockAcquire(&walsnd->mutex);
-   /* clear latch while holding the spinlock, so it can safely be read */
-   walsnd->latch = NULL;
    /* Mark WalSnd struct as no longer being in use. */
    walsnd->pid = 0;
    SpinLockRelease(&walsnd->mutex);
index cf32ac2488a8d16a1a2621ab8599220611b0d214..41ac736b953af8b583ac57130b0cc9f9b5128265 100644 (file)
@@ -18,7 +18,6 @@
 #include "nodes/replnodes.h"
 #include "replication/syncrep.h"
 #include "storage/condition_variable.h"
-#include "storage/latch.h"
 #include "storage/shmem.h"
 #include "storage/spin.h"
 
@@ -71,12 +70,6 @@ typedef struct WalSnd
    /* Protects shared variables in this structure. */
    slock_t     mutex;
 
-   /*
-    * Pointer to the walsender's latch. Used by backends to wake up this
-    * walsender when it has work to do. NULL if the walsender isn't active.
-    */
-   Latch      *latch;
-
    /*
     * Timestamp of the last message received from standby.
     */