amcheck: Remove unused GinScanItem->parentlsn field
authorTomas Vondra <[email protected]>
Tue, 17 Jun 2025 12:16:35 +0000 (14:16 +0200)
committerTomas Vondra <[email protected]>
Tue, 17 Jun 2025 12:17:38 +0000 (14:17 +0200)
The field was introduced by commit 14ffaece0fb5, but is unused and
unnecessary. So remove it.

Issues reported by Arseniy Mukhin, along with a proposed patch. Review
by Andrey M. Borodin, cleanup and minor improvements by me.

Author: Arseniy Mukhin <[email protected]>
Reviewed-by: Andrey M. Borodin <[email protected]>
Discussion: https://postgr.es/m/CAE7r3MJ611B9TE=YqBBncewp7-k64VWs+sjk7XF6fJUX77uFBA@mail.gmail.com

contrib/amcheck/verify_gin.c

index b5f363562e32ac1050b5b5474afed004abe6ab7e..3f81a8a81d291250044a90d534cbe94861f5f8d7 100644 (file)
@@ -38,7 +38,6 @@ typedef struct GinScanItem
    int         depth;
    IndexTuple  parenttup;
    BlockNumber parentblk;
-   XLogRecPtr  parentlsn;
    BlockNumber blkno;
    struct GinScanItem *next;
 } GinScanItem;
@@ -421,7 +420,6 @@ gin_check_parent_keys_consistency(Relation rel,
    stack->depth = 0;
    stack->parenttup = NULL;
    stack->parentblk = InvalidBlockNumber;
-   stack->parentlsn = InvalidXLogRecPtr;
    stack->blkno = GIN_ROOT_BLKNO;
 
    while (stack)
@@ -432,7 +430,6 @@ gin_check_parent_keys_consistency(Relation rel,
        OffsetNumber i,
                    maxoff,
                    prev_attnum;
-       XLogRecPtr  lsn;
        IndexTuple  prev_tuple;
        BlockNumber rightlink;
 
@@ -442,7 +439,6 @@ gin_check_parent_keys_consistency(Relation rel,
                                    RBM_NORMAL, strategy);
        LockBuffer(buffer, GIN_SHARE);
        page = (Page) BufferGetPage(buffer);
-       lsn = BufferGetLSNAtomic(buffer);
        maxoff = PageGetMaxOffsetNumber(page);
        rightlink = GinPageGetOpaque(page)->rightlink;
 
@@ -484,7 +480,6 @@ gin_check_parent_keys_consistency(Relation rel,
                ptr->depth = stack->depth;
                ptr->parenttup = CopyIndexTuple(stack->parenttup);
                ptr->parentblk = stack->parentblk;
-               ptr->parentlsn = stack->parentlsn;
                ptr->blkno = rightlink;
                ptr->next = stack->next;
                stack->next = ptr;
@@ -614,7 +609,6 @@ gin_check_parent_keys_consistency(Relation rel,
                    ptr->parenttup = NULL;
                ptr->parentblk = stack->blkno;
                ptr->blkno = GinGetDownlink(idxtuple);
-               ptr->parentlsn = lsn;
                ptr->next = stack->next;
                stack->next = ptr;
            }