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 95c373c2010 Fix errors for wal replication
95c373c2010 is described below

commit 95c373c2010df1de9c5cfbc2aaf458d213ed5cce
Author: Jinbao Chen <[email protected]>
AuthorDate: Fri Jan 30 22:35:02 2026 +0800

    Fix errors for wal replication
---
 src/backend/access/brin/brin_xlog.c   | 3 ++-
 src/backend/access/common/heaptuple.c | 5 ++---
 src/backend/cdb/cdbappendonlyxlog.c   | 7 ++++---
 src/backend/replication/walsender.c   | 6 +++++-
 src/bin/pg_basebackup/walmethods.c    | 6 ------
 src/bin/pg_basebackup/walmethods.h    | 6 ------
 src/include/access/htup_details.h     | 2 +-
 7 files changed, 14 insertions(+), 21 deletions(-)

diff --git a/src/backend/access/brin/brin_xlog.c 
b/src/backend/access/brin/brin_xlog.c
index 1077ae7e6cf..08e3aabe6a7 100644
--- a/src/backend/access/brin/brin_xlog.c
+++ b/src/backend/access/brin/brin_xlog.c
@@ -229,7 +229,8 @@ brin_xlog_revmap_extend(XLogReaderState *record)
         * GPDB: If we have registered backup block id = 2, it means that this 
index
         * is on an AO/CO relation, and we are extending a revmap chain.
         */
-       XLogRecGetBlockTag(record, 2, NULL, NULL, NULL);
+       ao_chain_exists = XLogRecGetBlockTagExtended(record, 2, NULL, NULL, 
NULL, NULL);
+       if (ao_chain_exists)
        {
                XLogRedoAction  currLastRevmapBufAction =
                                                          
XLogReadBufferForRedo(record, 2, &currLastRevmapBuf);
diff --git a/src/backend/access/common/heaptuple.c 
b/src/backend/access/common/heaptuple.c
index f7c8eccf74e..bcc17fac022 100644
--- a/src/backend/access/common/heaptuple.c
+++ b/src/backend/access/common/heaptuple.c
@@ -406,7 +406,7 @@ fill_val(Form_pg_attribute att,
  * @param isnull will only be used if <code>bit</code> is non-NULL
  * @param bit should be non-NULL (refer to td->t_bits) if isnull is set and 
contains non-null values
  */
-Size
+void
 heap_fill_tuple(TupleDesc tupleDesc,
                                Datum *values, bool *isnull,
                                char *data, Size data_size,
@@ -449,10 +449,9 @@ heap_fill_tuple(TupleDesc tupleDesc,
        }
 
        Assert((data - start) == data_size);
-
-       return data_size;
 }
 
+
 /* ----------------------------------------------------------------
  *                                             heap tuple interface
  * ----------------------------------------------------------------
diff --git a/src/backend/cdb/cdbappendonlyxlog.c 
b/src/backend/cdb/cdbappendonlyxlog.c
index 55678f33702..4b30d1552b1 100644
--- a/src/backend/cdb/cdbappendonlyxlog.c
+++ b/src/backend/cdb/cdbappendonlyxlog.c
@@ -107,9 +107,10 @@ ao_insert_replay(XLogReaderState *record)
                                                path)));
        }
 
-       register_dirty_segment_ao(xlrec->target.node,
-                                                         
xlrec->target.segment_filenum,
-                                                         file);
+       
+//     register_dirty_segment_ao(xlrec->target.node,
+//                                                       
xlrec->target.segment_filenum,
+//                                                       file);
 
        smgr->smgr_ao->smgr_FileClose(file);
 }
diff --git a/src/backend/replication/walsender.c 
b/src/backend/replication/walsender.c
index 014272acefc..cb26a20d996 100644
--- a/src/backend/replication/walsender.c
+++ b/src/backend/replication/walsender.c
@@ -3888,7 +3888,7 @@ offset_to_interval(TimeOffset offset)
 Datum
 pg_stat_get_wal_senders(PG_FUNCTION_ARGS)
 {
-#define PG_STAT_GET_WAL_SENDERS_COLS   12
+#define PG_STAT_GET_WAL_SENDERS_COLS   15
        ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo;
        SyncRepStandbyData *sync_standbys;
        int                     num_standbys;
@@ -4035,6 +4035,10 @@ pg_stat_get_wal_senders(PG_FUNCTION_ARGS)
                                nulls[11] = true;
                        else
                                values[11] = TimestampTzGetDatum(replyTime);
+
+                       nulls[12] = true;
+                       nulls[13] = true;
+                       nulls[14] = true;
                }
 
                tuplestore_putvalues(rsinfo->setResult, rsinfo->setDesc,
diff --git a/src/bin/pg_basebackup/walmethods.c 
b/src/bin/pg_basebackup/walmethods.c
index c4685f8c147..f21883d30d6 100644
--- a/src/bin/pg_basebackup/walmethods.c
+++ b/src/bin/pg_basebackup/walmethods.c
@@ -580,12 +580,6 @@ dir_get_file_size(WalWriteMethod *wwmethod, const char 
*pathname)
        return statbuf.st_size;
 }
 
-static int
-dir_compression(void)
-{
-       return dir_data->compression;
-}
-
 static bool
 dir_existsfile(WalWriteMethod *wwmethod, const char *pathname)
 {
diff --git a/src/bin/pg_basebackup/walmethods.h 
b/src/bin/pg_basebackup/walmethods.h
index 6388a49d502..e31c5c460bc 100644
--- a/src/bin/pg_basebackup/walmethods.h
+++ b/src/bin/pg_basebackup/walmethods.h
@@ -66,12 +66,6 @@ typedef struct WalWriteMethodOps
         */
        char       *(*get_file_name) (WalWriteMethod *wwmethod, const char 
*pathname, const char *temp_suffix);
 
-       /*
-        * Return the name of the current file to work on in pg_malloc()'d 
string,
-        * without the base directory.  This is useful for logging.
-        */
-       char       *(*get_file_name) (const char *pathname, const char 
*temp_suffix);
-
        /* Return the level of compression */
        int                     (*compression) (void);
 
diff --git a/src/include/access/htup_details.h 
b/src/include/access/htup_details.h
index cb368894656..5a1a014135c 100644
--- a/src/include/access/htup_details.h
+++ b/src/include/access/htup_details.h
@@ -716,7 +716,7 @@ extern Datum getmissingattr(TupleDesc tupleDesc,
 /* prototypes for functions in common/heaptuple.c */
 extern Size heap_compute_data_size(TupleDesc tupleDesc,
                                                                   Datum 
*values, bool *isnull);
-extern Size heap_fill_tuple(TupleDesc tupleDesc,
+extern void heap_fill_tuple(TupleDesc tupleDesc,
                                                        Datum *values, bool 
*isnull,
                                                        char *data, Size 
data_size,
                                                        uint16 *infomask, bits8 
*bit);


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

Reply via email to