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

chenjinbao1989 pushed a commit to branch cbdb-postgres-merge
in repository https://gitbox.apache.org/repos/asf/cloudberry.git


The following commit(s) were added to refs/heads/cbdb-postgres-merge by this 
push:
     new 7a3651a6fad Fix some conflict for untils/cache
7a3651a6fad is described below

commit 7a3651a6fad35456498028f533a848b69e6fc467
Author: Jinbao Chen <[email protected]>
AuthorDate: Mon Sep 1 09:34:01 2025 +0800

    Fix some conflict for untils/cache
---
 src/backend/utils/cache/catcache.c         | 12 ------
 src/backend/utils/cache/inval.c            | 34 -----------------
 src/backend/utils/cache/lsyscache.c        |  4 --
 src/backend/utils/cache/plancache.c        |  3 --
 src/backend/utils/cache/relfilenumbermap.c |  5 ---
 src/backend/utils/cache/relmapper.c        | 17 +--------
 src/backend/utils/cache/syscache.c         | 60 +++++++-----------------------
 src/backend/utils/cache/typcache.c         | 21 -----------
 8 files changed, 15 insertions(+), 141 deletions(-)

diff --git a/src/backend/utils/cache/catcache.c 
b/src/backend/utils/cache/catcache.c
index d5c1debd768..b31f0d51730 100644
--- a/src/backend/utils/cache/catcache.c
+++ b/src/backend/utils/cache/catcache.c
@@ -1520,7 +1520,6 @@ SearchCatCacheMiss(CatCache *cache,
        do
        {
                /*
-<<<<<<< HEAD
                 * Good place to sanity check the tuple, before adding it to 
cache.
                 * So if its fetched using index, lets cross verify tuple 
intended is the tuple
                 * fetched. If not fail and contain the damage which maybe 
caused due to
@@ -1540,17 +1539,6 @@ SearchCatCacheMiss(CatCache *cache,
                ResourceOwnerRememberCatCacheRef(CurrentResourceOwner, 
&ct->tuple);
                break;                                  /* assume only one 
match */
        }
-=======
-                * Ok, need to make a lookup in the relation, copy the scankey 
and
-                * fill out any per-call fields.  (We must re-do this when 
retrying,
-                * because systable_beginscan scribbles on the scankey.)
-                */
-               memcpy(cur_skey, cache->cc_skey, sizeof(ScanKeyData) * nkeys);
-               cur_skey[0].sk_argument = v1;
-               cur_skey[1].sk_argument = v2;
-               cur_skey[2].sk_argument = v3;
-               cur_skey[3].sk_argument = v4;
->>>>>>> REL_16_9
 
                scandesc = systable_beginscan(relation,
                                                                          
cache->cc_indexoid,
diff --git a/src/backend/utils/cache/inval.c b/src/backend/utils/cache/inval.c
index 3e2ee551659..962fcb82b86 100644
--- a/src/backend/utils/cache/inval.c
+++ b/src/backend/utils/cache/inval.c
@@ -306,24 +306,6 @@ AddInvalidationMessage(InvalidationMsgsGroup *group, int 
subgroup,
                        /* Create new storage array in TopTransactionContext */
                        int                     reqsize = 32;   /* arbitrary */
 
-<<<<<<< HEAD
-               /*
-                * Keep in mind: the max allowed alloc size is about 1GB, for
-                * simplification we set the upper limit to half of that.
-                */
-#define MAXCHUNKSIZE (MaxAllocSize / 2 / sizeof(SharedInvalidationMessage))
-               if (chunksize > MAXCHUNKSIZE)
-                       chunksize >>= 1;
-
-               chunk = (InvalidationChunk *)
-                       MemoryContextAlloc(CurTransactionContext,
-                                                          
offsetof(InvalidationChunk, msgs) +
-                                                          chunksize * 
sizeof(SharedInvalidationMessage));
-               chunk->nitems = 0;
-               chunk->maxitems = chunksize;
-               chunk->next = *listHdr;
-               *listHdr = chunk;
-=======
                        ima->msgs = (SharedInvalidationMessage *)
                                MemoryContextAlloc(TopTransactionContext,
                                                                   reqsize * 
sizeof(SharedInvalidationMessage));
@@ -340,7 +322,6 @@ AddInvalidationMessage(InvalidationMsgsGroup *group, int 
subgroup,
                                                 reqsize * 
sizeof(SharedInvalidationMessage));
                        ima->maxmsgs = reqsize;
                }
->>>>>>> REL_16_9
        }
        /* Okay, add message to current group */
        ima->msgs[nextindex] = *msg;
@@ -719,16 +700,9 @@ LocalExecuteInvalidationMessage(SharedInvalidationMessage 
*msg)
                 */
                RelFileLocatorBackend rlocator;
 
-<<<<<<< HEAD
-               memset(&rnode, 0, sizeof(RelFileNodeBackend));
-               rnode.node = msg->sm.rnode;
-               rnode.backend = (msg->sm.backend_hi << 16) | (int) 
msg->sm.backend_lo;
-               smgrclosenode(rnode);
-=======
                rlocator.locator = msg->sm.rlocator;
                rlocator.backend = (msg->sm.backend_hi << 16) | (int) 
msg->sm.backend_lo;
                smgrcloserellocator(rlocator);
->>>>>>> REL_16_9
        }
        else if (msg->id == SHAREDINVALRELMAP_ID)
        {
@@ -778,11 +752,7 @@ InvalidateSystemCachesExtended(bool debug_discard)
        int                     i;
 
        InvalidateCatalogSnapshot();
-<<<<<<< HEAD
        ResetCatalogCaches();
-=======
-       ResetCatalogCachesExt(debug_discard);
->>>>>>> REL_16_9
        RelationCacheInvalidate(debug_discard); /* gets smgr and relmap too */
 
        for (i = 0; i < syscache_callback_count; i++)
@@ -845,7 +815,6 @@ AcceptInvalidationMessages(void)
         * recursive reloads it's unlikely you'll learn more.
         *----------
         */
-<<<<<<< HEAD
 #if defined(CLOBBER_CACHE_ALWAYS)
        {
                static bool in_recursion = false;
@@ -858,9 +827,6 @@ AcceptInvalidationMessages(void)
                }
        }
 #elif defined(CLOBBER_CACHE_RECURSIVELY)
-=======
-#ifdef DISCARD_CACHES_ENABLED
->>>>>>> REL_16_9
        {
                static int      recursion_depth = 0;
 
diff --git a/src/backend/utils/cache/lsyscache.c 
b/src/backend/utils/cache/lsyscache.c
index f72503d72f7..a46e7c0ea59 100644
--- a/src/backend/utils/cache/lsyscache.c
+++ b/src/backend/utils/cache/lsyscache.c
@@ -3,13 +3,9 @@
  * lsyscache.c
  *       Convenience routines for common queries in the system catalog cache.
  *
-<<<<<<< HEAD
  * Portions Copyright (c) 2007-2009, Greenplum inc
  * Portions Copyright (c) 2012-Present VMware, Inc. or its affiliates.
- * Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group
-=======
  * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
->>>>>>> REL_16_9
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  * IDENTIFICATION
diff --git a/src/backend/utils/cache/plancache.c 
b/src/backend/utils/cache/plancache.c
index cb2e93c77c9..06c909b0aa8 100644
--- a/src/backend/utils/cache/plancache.c
+++ b/src/backend/utils/cache/plancache.c
@@ -1960,9 +1960,7 @@ ScanQueryForLocks(Query *parsetree, bool acquire)
                                break;
 
                        case RTE_SUBQUERY:
-<<<<<<< HEAD
                        case RTE_TABLEFUNCTION:
-=======
                                /* If this was a view, must lock/unlock the 
view */
                                if (OidIsValid(rte->relid))
                                {
@@ -1971,7 +1969,6 @@ ScanQueryForLocks(Query *parsetree, bool acquire)
                                        else
                                                UnlockRelationOid(rte->relid, 
rte->rellockmode);
                                }
->>>>>>> REL_16_9
                                /* Recurse into subquery-in-FROM */
                                ScanQueryForLocks(rte->subquery, acquire);
                                break;
diff --git a/src/backend/utils/cache/relfilenumbermap.c 
b/src/backend/utils/cache/relfilenumbermap.c
index cf232e2c170..220f33d43f5 100644
--- a/src/backend/utils/cache/relfilenumbermap.c
+++ b/src/backend/utils/cache/relfilenumbermap.c
@@ -37,13 +37,8 @@ static ScanKeyData relfilenumber_skey[2];
 typedef struct
 {
        Oid                     reltablespace;
-<<<<<<< HEAD:src/backend/utils/cache/relfilenodemap.c
-       Oid relfilenode;
-} RelfilenodeMapKey;
-=======
        RelFileNumber relfilenumber;
 } RelfilenumberMapKey;
->>>>>>> REL_16_9:src/backend/utils/cache/relfilenumbermap.c
 
 typedef struct
 {
diff --git a/src/backend/utils/cache/relmapper.c 
b/src/backend/utils/cache/relmapper.c
index 2051a50d0c8..5be45f2a78a 100644
--- a/src/backend/utils/cache/relmapper.c
+++ b/src/backend/utils/cache/relmapper.c
@@ -74,32 +74,17 @@
 #define RELMAPPER_FILEMAGIC            0x592717        /* version ID value */
 
 /*
-<<<<<<< HEAD
- * In Postgres, MAX_MAPPINGS is 62, but GPDB has exceeded this number due to
- * additional GPDB specific shared relations. Increased to 126 to occupy
- * exactly 1 kilobyte.
- *
- * New math: 126 * 8 + 16 = 1024
- */
-#define MAX_MAPPINGS                   126             /* 62 * 8 + 16 = 512 */
-
-typedef struct RelMapping
-{
-       Oid                         mapoid;                     /* OID of a 
catalog */
-       Oid                     mapfilenode;    /* its filenode number */
-=======
  * There's no need for this constant to have any particular value, and we
  * can raise it as necessary if we end up with more mapped relations. For
  * now, we just pick a round number that is modestly larger than the expected
  * number of mappings.
  */
-#define MAX_MAPPINGS                   64
+#define MAX_MAPPINGS                   126
 
 typedef struct RelMapping
 {
        Oid                     mapoid;                 /* OID of a catalog */
        RelFileNumber mapfilenumber;    /* its rel file number */
->>>>>>> REL_16_9
 } RelMapping;
 
 typedef struct RelMapFile
diff --git a/src/backend/utils/cache/syscache.c 
b/src/backend/utils/cache/syscache.c
index 4597e04a197..7000b1f8ba5 100644
--- a/src/backend/utils/cache/syscache.c
+++ b/src/backend/utils/cache/syscache.c
@@ -3,13 +3,9 @@
  * syscache.c
  *       System cache management routines
  *
-<<<<<<< HEAD
  * Portions Copyright (c) 2007-2010, Greenplum inc
  * Portions Copyright (c) 2012-Present VMware, Inc. or its affiliates.
- * Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group
-=======
  * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
->>>>>>> REL_16_9
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  *
@@ -342,34 +338,20 @@ static const struct cachedesc cacheinfo[] = {
                KEY(Anum_pg_event_trigger_oid),
                8
        },
-<<<<<<< HEAD
-       {ExtprotocolRelationId,         /* EXTPROTOCOLOID */
+       [EXTPROTOCOLOID] = {
+               ExtprotocolRelationId,
                ExtprotocolOidIndexId,
-               1,
-               {
-                       Anum_pg_extprotocol_oid,
-                       0,
-                       0,
-                       0
-               },
+               KEY(Anum_pg_extprotocol_oid),
                128
        },
-       {ExtprotocolRelationId,         /* EXTPROTOCOLNAME */
+       [EXTPROTOCOLNAME] = {
+               ExtprotocolRelationId,
                ExtprotocolPtcnameIndexId,
-               1,
-               {
-                       Anum_pg_extprotocol_ptcname,
-                       0,
-                       0,
-                       0
-               },
+               KEY(Anum_pg_extprotocol_ptcname),
                128
        },
-       {ForeignDataWrapperRelationId,  /* FOREIGNDATAWRAPPERNAME */
-=======
        [FOREIGNDATAWRAPPERNAME] = {
                ForeignDataWrapperRelationId,
->>>>>>> REL_16_9
                ForeignDataWrapperNameIndexId,
                KEY(Anum_pg_foreign_data_wrapper_fdwname),
                2
@@ -392,34 +374,20 @@ static const struct cachedesc cacheinfo[] = {
                KEY(Anum_pg_foreign_server_oid),
                2
        },
-<<<<<<< HEAD
-       {StorageServerRelationId,       /* STORAGESERVERNAME */
+       [STORAGESERVERNAME] = {
+               StorageServerRelationId,
                StorageServerNameIndexId,
-               1,
-               {
-                       Anum_gp_storage_server_srvname,
-                       0,
-                       0,
-                       0
-               },
-               2
+               KEY(Anum_gp_storage_server_srvname),
+               2
        },
-       {StorageServerRelationId,       /* STORAGESERVEROID */
+       [STORAGESERVEROID] = {
+               StorageServerRelationId,
                StorageServerOidIndexId,
-               1,
-               {
-                       Anum_gp_storage_server_oid,
-                       0,
-                       0,
-                       0
-               },
-               2
+               KEY(Anum_gp_storage_server_oid),
+               2
        },
-       {ForeignTableRelationId,        /* FOREIGNTABLEREL */
-=======
        [FOREIGNTABLEREL] = {
                ForeignTableRelationId,
->>>>>>> REL_16_9
                ForeignTableRelidIndexId,
                KEY(Anum_pg_foreign_table_ftrelid),
                4
diff --git a/src/backend/utils/cache/typcache.c 
b/src/backend/utils/cache/typcache.c
index e8197407ec4..fb59bef6807 100644
--- a/src/backend/utils/cache/typcache.c
+++ b/src/backend/utils/cache/typcache.c
@@ -275,24 +275,11 @@ static const dshash_parameters srtr_typmod_table_params = 
{
 /* hashtable for recognizing registered record types */
 static HTAB *RecordCacheHash = NULL;
 
-<<<<<<< HEAD
 /* arrays of info about registered record types, indexed by assigned typmod */
 static TupleDesc *RecordCacheArray = NULL;
 static uint64 *RecordIdentifierArray = NULL;
 static int32 RecordCacheArrayLen = 0;  /* allocated length of above arrays */
 int32 NextRecordTypmod = 0;    /* number of entries used */
-=======
-typedef struct RecordCacheArrayEntry
-{
-       uint64          id;
-       TupleDesc       tupdesc;
-} RecordCacheArrayEntry;
-
-/* array of info about registered record types, indexed by assigned typmod */
-static RecordCacheArrayEntry *RecordCacheArray = NULL;
-static int32 RecordCacheArrayLen = 0;  /* allocated length of above array */
-static int32 NextRecordTypmod = 0;     /* number of entries used */
->>>>>>> REL_16_9
 
 /*
  * Process-wide counter for generating unique tupledesc identifiers.
@@ -2014,11 +2001,7 @@ assign_record_type_typmod(TupleDesc tupDesc)
         * the allocations succeed before we create the new entry.
         */
        recentry = (RecordCacheEntry *) hash_search(RecordCacheHash,
-<<<<<<< HEAD
-                                                                               
                (void *) &tupDesc,
-=======
                                                                                
                &tupDesc,
->>>>>>> REL_16_9
                                                                                
                HASH_FIND, &found);
        if (found && recentry->tupdesc != NULL)
        {
@@ -2049,11 +2032,7 @@ assign_record_type_typmod(TupleDesc tupDesc)
                ensure_record_cache_typmod_slot_exists(entDesc->tdtypmod);
        }
 
-<<<<<<< HEAD
        RecordCacheArray[entDesc->tdtypmod] = entDesc;
-=======
-       RecordCacheArray[entDesc->tdtypmod].tupdesc = entDesc;
->>>>>>> REL_16_9
 
        /* Assign a unique tupdesc identifier, too. */
        RecordCacheArray[entDesc->tdtypmod].id = ++tupledesc_id_counter;


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to