This is an automated email from the ASF dual-hosted git repository.

yjhjstz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry.git

commit 1eea879f729c60d35168916ba0e641c252eeebd1
Author: Soumyadeep Chakraborty <soumyadeep2...@gmail.com>
AuthorDate: Fri Mar 17 17:55:49 2023 -0700

    Assert AO/CO exclusion for anti-wraparound vacuums
    
    Anti-wraparound autovacuums are meant primarily to update transaction
    metadata and currently they are executed on user tables as well.
    Executing them on AO tables is pointless from this perspective as they
    don't carry any transaction metadata, and will lead to unintended cycles
    spent on vacuuming their contents. Their aux tables carry it and will be
    anti-wraparound autovacuumed anyway.
    
    This is already enforced in the code, add an assert for the same.
    
    Co-authored-by: Ashwin Agrawal <aash...@vmware.com>
---
 src/backend/postmaster/autovacuum.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/backend/postmaster/autovacuum.c 
b/src/backend/postmaster/autovacuum.c
index 6a82a5ec3d..0379659f99 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -3273,6 +3273,15 @@ relation_needs_vacanalyze(Oid relid,
        xidForceLimit = recentXid - freeze_max_age;
        if (xidForceLimit < FirstNormalTransactionId)
                xidForceLimit -= FirstNormalTransactionId;
+       /*
+        * GPDB: Append-optimized tables don't have any transaction IDs and 
don't
+        * need to be considered for anti-wraparound vacuums. They are 
implicitly
+        * excluded from anti-wraparound vacuums below since their relfrozenxid 
is
+        * always InvalidTransactionId.
+        */
+       AssertImply(IsAccessMethodAO(classForm->relam),
+                               !TransactionIdIsValid(classForm->relfrozenxid));
+
        force_vacuum = (TransactionIdIsNormal(classForm->relfrozenxid) &&
                                        
TransactionIdPrecedes(classForm->relfrozenxid,
                                                                                
  xidForceLimit));


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cloudberry.apache.org
For additional commands, e-mail: commits-h...@cloudberry.apache.org

Reply via email to