Skip to content

Commit 92b6932

Browse files
mrdrivingduckclaude
andcommitted
merge: resolve merge conflicts from REL_17_10
Resolve seven merge conflicts introduced by upstream REL_17_10: visibilitymap: keep macros in the header file per PolarDB convention and add the new HEAPBLK_TO_MAPBLOCK_LIMIT macro there as well. multixact: retain PolarDB's local cache macro alongside upstream's expanded comment and new last_initialized_offsets_page variable. slotsync: combine upstream's parameter_changed condition with PolarDB's hot_standby_feedback check, preserving upstream's comment. walsender: drop the unused fullyAppliedLastTime variable, keep PolarDB's polar_bg_replay_lsn, and add upstream's prevWritePtr, prevFlushPtr, and prevApplyPtr static variables. pg_config.h.in: keep PolarDB's PFSD_VERSION and add upstream's PG_CXX_PRINTF_ATTRIBUTE and PG_C_PRINTF_ATTRIBUTE definitions. procsignal: add upstream's PROCSIG_SLOTSYNC_MESSAGE before PolarDB's POLAR_PROCSIG_BACKEND_MEMORY_CONTEXT, both preceding NUM_PROCSIGNALS. test/Makefile: keep PolarDB's comment and ordering, add postmaster to the SUBDIRS list. Also apply style fixes to upstream-introduced files: rewrap comments in xslt_proc.c and applyparallelworker.c, and fix line wrapping in 004_negotiate.pl and 011_ib_truncation.pl. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 6a34139 commit 92b6932

12 files changed

Lines changed: 23 additions & 68 deletions

File tree

contrib/xml2/xslt_proc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ xslt_process(PG_FUNCTION_ARGS)
180180
PG_RETURN_NULL();
181181

182182
/*
183-
* If an empty string has been returned, resstr would be NULL. In
184-
* this case, assume that the result is an empty string.
183+
* If an empty string has been returned, resstr would be NULL. In this
184+
* case, assume that the result is an empty string.
185185
*/
186186
if (reslen == 0)
187187
result = cstring_to_text("");

src/backend/access/heap/visibilitymap.c

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -104,29 +104,6 @@
104104

105105
/*#define TRACE_VISIBILITYMAP */
106106

107-
<<<<<<< HEAD
108-
=======
109-
/*
110-
* Size of the bitmap on each visibility map page, in bytes. There's no
111-
* extra headers, so the whole page minus the standard page header is
112-
* used for the bitmap.
113-
*/
114-
#define MAPSIZE (BLCKSZ - MAXALIGN(SizeOfPageHeaderData))
115-
116-
/* Number of heap blocks we can represent in one byte */
117-
#define HEAPBLOCKS_PER_BYTE (BITS_PER_BYTE / BITS_PER_HEAPBLOCK)
118-
119-
/* Number of heap blocks we can represent in one visibility map page. */
120-
#define HEAPBLOCKS_PER_PAGE (MAPSIZE * HEAPBLOCKS_PER_BYTE)
121-
122-
/* Mapping from heap block number to the right bit in the visibility map */
123-
#define HEAPBLK_TO_MAPBLOCK(x) ((x) / HEAPBLOCKS_PER_PAGE)
124-
#define HEAPBLK_TO_MAPBLOCK_LIMIT(x) \
125-
(((x) + HEAPBLOCKS_PER_PAGE - 1) / HEAPBLOCKS_PER_PAGE)
126-
#define HEAPBLK_TO_MAPBYTE(x) (((x) % HEAPBLOCKS_PER_PAGE) / HEAPBLOCKS_PER_BYTE)
127-
#define HEAPBLK_TO_OFFSET(x) (((x) % HEAPBLOCKS_PER_BYTE) * BITS_PER_HEAPBLOCK)
128-
129-
>>>>>>> REL_17_10
130107
/* Masks for counting subsets of bits in the visibility map. */
131108
#define VISIBLE_MASK8 (0x55) /* The lower bit of each bit pair */
132109
#define FROZEN_MASK8 (0xaa) /* The upper bit of each bit pair */

src/backend/access/transam/multixact.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -416,13 +416,10 @@ static MemoryContext MXactContext = NULL;
416416
#define debug_elog6(a,b,c,d,e,f)
417417
#endif
418418

419-
<<<<<<< HEAD
420419
/* POLAR: Check whether multixact local file cache is enabled */
421420
#define POLAR_ENABLE_MULTIXACT_LOCAL_CACHE() \
422421
(polar_multixact_max_local_cache_segments > 0 && polar_enable_shared_storage_mode)
423422

424-
/* hack to deal with WAL generated with older minor versions */
425-
=======
426423
/*
427424
* Hack to deal with WAL generated with older minor versions.
428425
*
@@ -434,7 +431,6 @@ static MemoryContext MXactContext = NULL;
434431
* seen a XLOG_MULTIXACT_ZERO_OFF_PAGE record for the page yet.
435432
*/
436433
static int64 last_initialized_offsets_page = -1;
437-
>>>>>>> REL_17_10
438434
static int64 pre_initialized_offsets_page = -1;
439435

440436
/* internal MultiXactId management */

src/backend/replication/logical/applyparallelworker.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -813,10 +813,10 @@ LogicalParallelApplyLoop(shm_mq_handle *mqh)
813813
ResetLatch(MyLatch);
814814

815815
/*
816-
* Force stats reporting to avoid long delays. There can be long
817-
* idle gaps before the leader assigns the next transaction, and
818-
* the only opportunity to report stats during such gaps is
819-
* here.
816+
* Force stats reporting to avoid long delays. There can be
817+
* long idle gaps before the leader assigns the next
818+
* transaction, and the only opportunity to report stats
819+
* during such gaps is here.
820820
*/
821821
if ((rc & WL_TIMEOUT) && !IsTransactionState())
822822
pgstat_report_stat(true);

src/backend/replication/logical/slotsync.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,17 +1192,12 @@ slotsync_reread_config(void)
11921192
}
11931193
}
11941194

1195-
<<<<<<< HEAD
1196-
if (conninfo_changed ||
1197-
primary_slotname_changed ||
1198-
(old_hot_standby_feedback != POLAR_ENABLE_FEEDBACK()))
1199-
=======
12001195
/*
12011196
* If we have reached here with a parameter change, we must be running in
12021197
* SQL function, emit error in such a case.
12031198
*/
1204-
if (parameter_changed)
1205-
>>>>>>> REL_17_10
1199+
if (parameter_changed ||
1200+
(old_hot_standby_feedback != POLAR_ENABLE_FEEDBACK()))
12061201
{
12071202
Assert(!is_slotsync_worker);
12081203
ereport(ERROR,

src/backend/replication/walsender.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2615,14 +2615,10 @@ ProcessStandbyReplyMessage(void)
26152615
TimestampTz now;
26162616
TimestampTz replyTime;
26172617

2618-
<<<<<<< HEAD
2619-
static bool fullyAppliedLastTime = false;
26202618
XLogRecPtr polar_bg_replay_lsn = InvalidXLogRecPtr;
2621-
=======
26222619
static XLogRecPtr prevWritePtr = InvalidXLogRecPtr;
26232620
static XLogRecPtr prevFlushPtr = InvalidXLogRecPtr;
26242621
static XLogRecPtr prevApplyPtr = InvalidXLogRecPtr;
2625-
>>>>>>> REL_17_10
26262622

26272623
/* the caller already consumed the msgtype byte */
26282624
writePtr = pq_getmsgint64(&reply_message);

src/bin/pg_combinebackup/t/011_ib_truncation.pl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,17 +91,17 @@
9191
# truncation limit. We can't just check whether the restored VM fork is
9292
# the right size on disk, because it's so small that the incremental backup
9393
# code will send the entire file.
94-
my $relfilenode = $primary->safe_psql('postgres',
95-
"SELECT pg_relation_filenode('t');");
96-
my $vm_limits = $primary->safe_psql('postgres',
94+
my $relfilenode =
95+
$primary->safe_psql('postgres', "SELECT pg_relation_filenode('t');");
96+
my $vm_limits = $primary->safe_psql(
97+
'postgres',
9798
"SELECT string_agg(relblocknumber::text, ',')
9899
FROM pg_available_wal_summaries() s,
99100
pg_wal_summary_contents(s.tli, s.start_lsn, s.end_lsn) c
100101
WHERE c.relfilenode = $relfilenode
101102
AND c.relforknumber = 2
102103
AND c.is_limit_block;");
103-
is($vm_limits, '1',
104-
'WAL summary has correct VM fork truncation limit');
104+
is($vm_limits, '1', 'WAL summary has correct VM fork truncation limit');
105105

106106
# Combine full and incremental backups. Before the fix, this failed because
107107
# the INCREMENTAL file header contained an incorrect truncation_block value.

src/include/access/visibilitymap.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ extern BlockNumber visibilitymap_truncation_length(BlockNumber nheapblocks);
7373

7474
/* Mapping from heap block number to the right bit in the visibility map */
7575
#define HEAPBLK_TO_MAPBLOCK(x) ((x) / HEAPBLOCKS_PER_PAGE)
76+
#define HEAPBLK_TO_MAPBLOCK_LIMIT(x) \
77+
(((x) + HEAPBLOCKS_PER_PAGE - 1) / HEAPBLOCKS_PER_PAGE)
7678
#define HEAPBLK_TO_MAPBYTE(x) (((x) % HEAPBLOCKS_PER_PAGE) / HEAPBLOCKS_PER_BYTE)
7779
#define HEAPBLK_TO_OFFSET(x) (((x) % HEAPBLOCKS_PER_BYTE) * BITS_PER_HEAPBLOCK)
7880

src/include/pg_config.h.in

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -631,18 +631,16 @@
631631
/* Define to the version of this package. */
632632
#undef PACKAGE_VERSION
633633

634-
<<<<<<< HEAD
635634
/* PFSD version number */
636635
#undef PFSD_VERSION
637-
=======
636+
638637
/* Define to best C++ printf format archetype, usually gnu_printf if
639638
available. */
640639
#undef PG_CXX_PRINTF_ATTRIBUTE
641640

642641
/* Define to best C printf format archetype, usually gnu_printf if available.
643642
*/
644643
#undef PG_C_PRINTF_ATTRIBUTE
645-
>>>>>>> REL_17_10
646644

647645
/* Define to the name of a signed 128-bit integer type. */
648646
#undef PG_INT128_TYPE

src/include/storage/procsignal.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,10 @@ typedef enum
4848
PROCSIG_RECOVERY_CONFLICT_STARTUP_DEADLOCK,
4949
PROCSIG_RECOVERY_CONFLICT_LAST = PROCSIG_RECOVERY_CONFLICT_STARTUP_DEADLOCK,
5050

51-
<<<<<<< HEAD
51+
PROCSIG_SLOTSYNC_MESSAGE, /* ask slot synchronization to stop */
52+
5253
/* POLAR */
5354
POLAR_PROCSIG_BACKEND_MEMORY_CONTEXT,
54-
=======
55-
PROCSIG_SLOTSYNC_MESSAGE, /* ask slot synchronization to stop */
56-
>>>>>>> REL_17_10
5755

5856
NUM_PROCSIGNALS /* Must be last! */
5957
} ProcSignalReason;

0 commit comments

Comments
 (0)