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 5e48c8f3ba4 Fix conflicts for storage/ipc
5e48c8f3ba4 is described below
commit 5e48c8f3ba45b32002b8a98a6aab093182537362
Author: Jinbao Chen <[email protected]>
AuthorDate: Mon Jul 28 09:21:53 2025 +0800
Fix conflicts for storage/ipc
---
src/backend/storage/ipc/dsm_impl.c | 32 -------
src/backend/storage/ipc/ipc.c | 3 -
src/backend/storage/ipc/ipci.c | 179 +++++++++++------------------------
src/backend/storage/ipc/latch.c | 25 -----
src/backend/storage/ipc/procarray.c | 167 --------------------------------
src/backend/storage/ipc/procsignal.c | 3 -
src/backend/storage/ipc/shm_mq.c | 4 +-
src/backend/storage/ipc/sinval.c | 6 --
src/backend/storage/ipc/standby.c | 14 ---
9 files changed, 54 insertions(+), 379 deletions(-)
diff --git a/src/backend/storage/ipc/dsm_impl.c
b/src/backend/storage/ipc/dsm_impl.c
index ec5c2a2bd7a..0f88286aa29 100644
--- a/src/backend/storage/ipc/dsm_impl.c
+++ b/src/backend/storage/ipc/dsm_impl.c
@@ -354,24 +354,6 @@ dsm_impl_posix_resize(int fd, off_t size)
int rc;
int save_errno;
sigset_t save_sigmask;
-<<<<<<< HEAD
-
- /*
- * Block all blockable signals, except SIGQUIT. posix_fallocate() can
run
- * for quite a long time, and is an all-or-nothing operation. If we
- * allowed SIGUSR1 to interrupt us repeatedly (for example, due to
recovery
- * conflicts), the retry loop might never succeed.
- */
- if (IsUnderPostmaster)
- sigprocmask(SIG_SETMASK, &BlockSig, &save_sigmask);
-
- /* Truncate (or extend) the file to the requested size. */
- do
- {
- rc = ftruncate(fd, size);
- } while (rc < 0 && errno == EINTR);
-=======
->>>>>>> REL_16_9
/*
* Block all blockable signals, except SIGQUIT. posix_fallocate() can
run
@@ -399,22 +381,8 @@ dsm_impl_posix_resize(int fd, off_t size)
*/
do
{
-<<<<<<< HEAD
- /*
- * We still use a traditional EINTR retry loop to handle
SIGCONT.
- * posix_fallocate() doesn't restart automatically, and we
don't want
- * this to fail if you attach a debugger.
- */
- pgstat_report_wait_start(WAIT_EVENT_DSM_FILL_ZERO_WRITE);
- do
- {
- rc = posix_fallocate(fd, 0, size);
- } while (rc == EINTR);
- pgstat_report_wait_end();
-=======
rc = posix_fallocate(fd, 0, size);
} while (rc == EINTR);
->>>>>>> REL_16_9
/*
* The caller expects errno to be set, but posix_fallocate() doesn't set
diff --git a/src/backend/storage/ipc/ipc.c b/src/backend/storage/ipc/ipc.c
index 8e731724adf..7e74f8a0be2 100644
--- a/src/backend/storage/ipc/ipc.c
+++ b/src/backend/storage/ipc/ipc.c
@@ -103,10 +103,7 @@ static int on_proc_exit_index,
void
proc_exit(int code)
{
-<<<<<<< HEAD
pqsignal(SIGALRM, SIG_IGN);
-=======
->>>>>>> REL_16_9
/* not safe if forked by system(), etc. */
if (MyProcPid != (int) getpid())
elog(PANIC, "proc_exit() called in child process");
diff --git a/src/backend/storage/ipc/ipci.c b/src/backend/storage/ipc/ipci.c
index 5977d41c750..e0ced5a583e 100644
--- a/src/backend/storage/ipc/ipci.c
+++ b/src/backend/storage/ipc/ipci.c
@@ -25,14 +25,11 @@
#include "access/subtrans.h"
#include "access/syncscan.h"
#include "access/twophase.h"
-<<<<<<< HEAD
#include "access/distributedlog.h"
#include "cdb/cdblocaldistribxact.h"
#include "cdb/cdbvars.h"
-=======
#include "access/xlogprefetcher.h"
#include "access/xlogrecovery.h"
->>>>>>> REL_16_9
#include "commands/async.h"
#include "commands/matview.h"
#include "crypto/kmgr.h"
@@ -61,16 +58,13 @@
#include "storage/procsignal.h"
#include "storage/sinvaladt.h"
#include "storage/spin.h"
-<<<<<<< HEAD
#include "task/pg_cron.h"
#include "utils/backend_cancel.h"
#include "utils/resource_manager.h"
#include "utils/faultinjector.h"
#include "utils/sharedsnapshot.h"
#include "utils/gpexpand.h"
-=======
#include "utils/guc.h"
->>>>>>> REL_16_9
#include "utils/snapmgr.h"
#include "libpq-fe.h"
@@ -147,12 +141,26 @@ CalculateShmemSize(int *num_semaphores)
sizeof(ShmemIndexEnt)));
size = add_size(size, dsm_estimate_size());
size = add_size(size, BufferShmemSize());
+ size = add_size(size, GpParallelDSMHashSize());
size = add_size(size, LockShmemSize());
size = add_size(size, PredicateLockShmemSize());
+ if (IsResQueueEnabled() && (Gp_role == GP_ROLE_DISPATCH ||
IS_SINGLENODE()))
+ {
+ size = add_size(size, ResSchedulerShmemSize());
+ size = add_size(size, ResPortalIncrementShmemSize());
+ }
+ else if (IsResGroupEnabled())
+ size = add_size(size, ResGroupShmemSize());
+ size = add_size(size, SharedSnapshotShmemSize());
+#ifdef USE_INTERNAL_FTS
+ if (Gp_role == GP_ROLE_DISPATCH || Gp_role == GP_ROLE_UTILITY)
+ size = add_size(size, FtsShmemSize());
+#endif
size = add_size(size, ProcGlobalShmemSize());
size = add_size(size, XLogPrefetchShmemSize());
size = add_size(size, XLOGShmemSize());
size = add_size(size, XLogRecoveryShmemSize());
+ size = add_size(size, DistributedLog_ShmemSize());
size = add_size(size, CLOGShmemSize());
size = add_size(size, CommitTsShmemSize());
size = add_size(size, SUBTRANSShmemSize());
@@ -167,26 +175,64 @@ CalculateShmemSize(int *num_semaphores)
size = add_size(size, ProcSignalShmemSize());
size = add_size(size, CheckpointerShmemSize());
size = add_size(size, AutoVacuumShmemSize());
+ size = add_size(size, LoginMonitorShmemSize());
size = add_size(size, ReplicationSlotsShmemSize());
size = add_size(size, ReplicationOriginShmemSize());
size = add_size(size, WalSndShmemSize());
size = add_size(size, WalRcvShmemSize());
size = add_size(size, PgArchShmemSize());
size = add_size(size, ApplyLauncherShmemSize());
+ size = add_size(size, FTSReplicationStatusShmemSize());
+ size = add_size(size, PgCronLauncherShmemSize());
size = add_size(size, SnapMgrShmemSize());
size = add_size(size, BTreeShmemSize());
size = add_size(size, SyncScanShmemSize());
size = add_size(size, AsyncShmemSize());
size = add_size(size, StatsShmemSize());
+ size = add_size(size, KmgrShmemSize());
#ifdef EXEC_BACKEND
size = add_size(size, ShmemBackendArraySize());
#endif
+ size = add_size(size, tmShmemSize());
+ size = add_size(size, CheckpointerShmemSize());
+ size = add_size(size, CancelBackendMsgShmemSize());
+ size = add_size(size, WorkFileShmemSize());
+ size = add_size(size, ShareInputShmemSize());
+
+#ifdef FAULT_INJECTOR
+ size = add_size(size, FaultInjector_ShmemSize());
+#endif
+
+ /* This elog happens before we know the name of the log file we are
supposed to use */
+ elog(DEBUG1, "Size not including the buffer pool %lu",
+ (unsigned long) size);
/* include additional requested shmem from preload libraries */
size = add_size(size, total_addin_request);
/* might as well round it off to a multiple of a typical page size */
- size = add_size(size, 8192 - (size % 8192));
+ size = add_size(size, BLCKSZ - (size % BLCKSZ));
+
+ /* Consider the size of the SessionState array */
+ size = add_size(size, SessionState_ShmemSize());
+
+ /* size of Instrumentation slots */
+ size = add_size(size, InstrShmemSize());
+
+ /* size of expand version */
+ size = add_size(size, GpExpandVersionShmemSize());
+
+ /* size of token and endpoint shared memory */
+ size = add_size(size, EndpointShmemSize());
+#ifndef USE_INTERNAL_FTS
+ /* size of cdb etcd result cache */
+ if (Gp_role != GP_ROLE_EXECUTE)
+ size = add_size(size, ShmemSegmentConfigsCacheSize());
+
+ /* size of standby promote flags */
+ size = add_size(size, ShmemStandbyPromoteReadySize());
+#endif
+ size = add_size(size, mv_TableShmemSize());
return size;
}
@@ -217,124 +263,8 @@ CreateSharedMemoryAndSemaphores(void)
Size size;
int numSemas;
-<<<<<<< HEAD
- /* Compute number of semaphores we'll need */
- numSemas = ProcGlobalSemas();
- numSemas += SpinlockSemas();
-
- elog(DEBUG3,"reserving %d semaphores",numSemas);
- /*
- * Size of the Postgres shared-memory block is estimated via
- * moderately-accurate estimates for the big hogs, plus 100K
for the
- * stuff that's too small to bother with estimating.
- *
- * We take some care during this phase to ensure that the total
size
- * request doesn't overflow size_t. If this gets through, we
don't
- * need to be so careful during the actual allocation phase.
- */
- size = 150000;
- size = add_size(size, PGSemaphoreShmemSize(numSemas));
- size = add_size(size, SpinlockSemaSize());
- size = add_size(size, hash_estimate_size(SHMEM_INDEX_SIZE,
-
sizeof(ShmemIndexEnt)));
- size = add_size(size, dsm_estimate_size());
- size = add_size(size, BufferShmemSize());
- size = add_size(size, GpParallelDSMHashSize());
- size = add_size(size, LockShmemSize());
- size = add_size(size, PredicateLockShmemSize());
-
- if (IsResQueueEnabled() && (Gp_role == GP_ROLE_DISPATCH ||
IS_SINGLENODE()))
- {
- size = add_size(size, ResSchedulerShmemSize());
- size = add_size(size, ResPortalIncrementShmemSize());
- }
- else if (IsResGroupEnabled())
- size = add_size(size, ResGroupShmemSize());
- size = add_size(size, SharedSnapshotShmemSize());
-#ifdef USE_INTERNAL_FTS
- if (Gp_role == GP_ROLE_DISPATCH || Gp_role == GP_ROLE_UTILITY)
- size = add_size(size, FtsShmemSize());
-#endif
- size = add_size(size, ProcGlobalShmemSize());
- size = add_size(size, XLOGShmemSize());
- size = add_size(size, DistributedLog_ShmemSize());
- size = add_size(size, CLOGShmemSize());
- size = add_size(size, CommitTsShmemSize());
- size = add_size(size, SUBTRANSShmemSize());
- size = add_size(size, TwoPhaseShmemSize());
- size = add_size(size, BackgroundWorkerShmemSize());
- size = add_size(size, MultiXactShmemSize());
- size = add_size(size, LWLockShmemSize());
- size = add_size(size, ProcArrayShmemSize());
- size = add_size(size, BackendStatusShmemSize());
- size = add_size(size, SInvalShmemSize());
- size = add_size(size, PMSignalShmemSize());
- size = add_size(size, ProcSignalShmemSize());
- size = add_size(size, CheckpointerShmemSize());
- size = add_size(size, AutoVacuumShmemSize());
- size = add_size(size, LoginMonitorShmemSize());
- size = add_size(size, ReplicationSlotsShmemSize());
- size = add_size(size, ReplicationOriginShmemSize());
- size = add_size(size, WalSndShmemSize());
- size = add_size(size, WalRcvShmemSize());
- size = add_size(size, PgArchShmemSize());
- size = add_size(size, ApplyLauncherShmemSize());
- size = add_size(size, FTSReplicationStatusShmemSize());
- size = add_size(size, PgCronLauncherShmemSize());
- size = add_size(size, SnapMgrShmemSize());
- size = add_size(size, BTreeShmemSize());
- size = add_size(size, SyncScanShmemSize());
- size = add_size(size, AsyncShmemSize());
- size = add_size(size, KmgrShmemSize());
-#ifdef EXEC_BACKEND
- size = add_size(size, ShmemBackendArraySize());
-#endif
-
- size = add_size(size, tmShmemSize());
- size = add_size(size, CheckpointerShmemSize());
- size = add_size(size, CancelBackendMsgShmemSize());
- size = add_size(size, WorkFileShmemSize());
- size = add_size(size, ShareInputShmemSize());
-
-#ifdef FAULT_INJECTOR
- size = add_size(size, FaultInjector_ShmemSize());
-#endif
-
- /* This elog happens before we know the name of the log file we
are supposed to use */
- elog(DEBUG1, "Size not including the buffer pool %lu",
- (unsigned long) size);
-
- /* freeze the addin request size and include it */
- addin_request_allowed = false;
- size = add_size(size, total_addin_request);
-
- /* might as well round it off to a multiple of a typical page
size */
- size = add_size(size, BLCKSZ - (size % BLCKSZ));
-
- /* Consider the size of the SessionState array */
- size = add_size(size, SessionState_ShmemSize());
-
- /* size of Instrumentation slots */
- size = add_size(size, InstrShmemSize());
-
- /* size of expand version */
- size = add_size(size, GpExpandVersionShmemSize());
-
- /* size of token and endpoint shared memory */
- size = add_size(size, EndpointShmemSize());
-#ifndef USE_INTERNAL_FTS
- /* size of cdb etcd result cache */
- if (Gp_role != GP_ROLE_EXECUTE)
- size = add_size(size, ShmemSegmentConfigsCacheSize());
-
- /* size of standby promote flags */
- size = add_size(size, ShmemStandbyPromoteReadySize());
-#endif
- size = add_size(size, mv_TableShmemSize());
-=======
/* Compute the size of the shared-memory block */
size = CalculateShmemSize(&numSemas);
->>>>>>> REL_16_9
elog(DEBUG3, "invoking IpcMemoryCreate(size=%zu)", size);
/*
@@ -481,7 +411,6 @@ CreateSharedMemoryAndSemaphores(void)
BTreeShmemInit();
SyncScanShmemInit();
AsyncShmemInit();
-<<<<<<< HEAD
BackendCancelShmemInit();
WorkFileShmemInit();
ShareInputShmemInit();
@@ -494,9 +423,7 @@ CreateSharedMemoryAndSemaphores(void)
GpExpandVersionShmemInit();
KmgrShmemInit();
-=======
StatsShmemInit();
->>>>>>> REL_16_9
#ifdef EXEC_BACKEND
diff --git a/src/backend/storage/ipc/latch.c b/src/backend/storage/ipc/latch.c
index 0f1dd0cb98e..00bd3b09e40 100644
--- a/src/backend/storage/ipc/latch.c
+++ b/src/backend/storage/ipc/latch.c
@@ -84,25 +84,6 @@
#error "no wait set implementation available"
#endif
-<<<<<<< HEAD
-=======
-/*
- * By default, we use a self-pipe with poll() and a signalfd with epoll(), if
- * available. We avoid signalfd on illumos for now based on problem reports.
- * For testing the choice can also be manually specified.
- */
-#if defined(WAIT_USE_POLL) || defined(WAIT_USE_EPOLL)
-#if defined(WAIT_USE_SELF_PIPE) || defined(WAIT_USE_SIGNALFD)
-/* don't overwrite manual choice */
-#elif defined(WAIT_USE_EPOLL) && defined(HAVE_SYS_SIGNALFD_H) && \
- !defined(__illumos__)
-#define WAIT_USE_SIGNALFD
-#else
-#define WAIT_USE_SELF_PIPE
-#endif
-#endif
-
->>>>>>> REL_16_9
/* typedef in latch.h */
struct WaitEventSet
{
@@ -453,15 +434,9 @@ OwnLatch(Latch *latch)
Assert(signal_fd >= 0);
#endif
-<<<<<<< HEAD
- if (latch->owner_pid != 0)
- elog(ERROR, "latch already owned by pid %d (is_set: %d)",
- latch->owner_pid, (int) latch->is_set);
-=======
owner_pid = latch->owner_pid;
if (owner_pid != 0)
elog(PANIC, "latch already owned by PID %d", owner_pid);
->>>>>>> REL_16_9
latch->owner_pid = MyProcPid;
}
diff --git a/src/backend/storage/ipc/procarray.c
b/src/backend/storage/ipc/procarray.c
index c4937e505ed..06e37a44781 100644
--- a/src/backend/storage/ipc/procarray.c
+++ b/src/backend/storage/ipc/procarray.c
@@ -271,8 +271,6 @@ typedef enum GlobalVisHorizonKind
VISHORIZON_TEMP
} GlobalVisHorizonKind;
-<<<<<<< HEAD
-=======
/*
* Reason codes for KnownAssignedXidsCompress().
*/
@@ -284,7 +282,6 @@ typedef enum KAXCompressReason
KAX_STARTUP_PROCESS_IDLE /* startup process is about to sleep */
} KAXCompressReason;
->>>>>>> REL_16_9
static ProcArrayStruct *procArray;
@@ -797,14 +794,6 @@ ProcArrayEndTransaction(PGPROC *proc, TransactionId
latestXid)
/* avoid unnecessarily dirtying shared cachelines */
if (proc->statusFlags & PROC_VACUUM_STATE_MASK)
{
-<<<<<<< HEAD
- Assert(!LWLockHeldByMe(ProcArrayLock));
- LWLockAcquire(ProcArrayLock, LW_EXCLUSIVE);
- Assert(proc->statusFlags ==
ProcGlobal->statusFlags[proc->pgxactoff]);
- proc->statusFlags &= ~PROC_VACUUM_STATE_MASK;
- ProcGlobal->statusFlags[proc->pgxactoff] = proc->statusFlags;
- LWLockRelease(ProcArrayLock);
-=======
/*
* If we have no XID, we don't need to lock, since we won't
affect
* anyone else's calculation of a snapshot. We might change
their
@@ -833,7 +822,6 @@ ProcArrayEndTransaction(PGPROC *proc, TransactionId
latestXid)
ProcGlobal->statusFlags[proc->pgxactoff] =
proc->statusFlags;
LWLockRelease(ProcArrayLock);
}
->>>>>>> REL_16_9
}
resetTmGxact();
@@ -862,14 +850,8 @@ ProcArrayEndTransactionInternal(PGPROC *proc,
TransactionId latestXid)
proc->lxid = InvalidLocalTransactionId;
proc->xmin = InvalidTransactionId;
-<<<<<<< HEAD
- /* be sure these are cleared in abort */
- proc->delayChkpt = false;
- proc->delayChkptEnd = false;
-=======
/* be sure this is cleared in abort */
proc->delayChkptFlags = 0;
->>>>>>> REL_16_9
proc->recoveryConflictPending = false;
@@ -984,7 +966,6 @@ ProcArrayGroupClearXid(PGPROC *proc, TransactionId
latestXid)
while (nextidx != INVALID_PGPROCNO)
{
PGPROC *nextproc = &allProcs[nextidx];
-<<<<<<< HEAD
TMGXACT *tmGxact = &allTmGxact[nextidx];
if (TransactionIdIsValid(nextproc->procArrayGroupMemberXid))
@@ -992,10 +973,6 @@ ProcArrayGroupClearXid(PGPROC *proc, TransactionId
latestXid)
if (TransactionIdIsValid(tmGxact->gxid))
ProcArrayEndGxact(tmGxact);
-=======
-
- ProcArrayEndTransactionInternal(nextproc,
nextproc->procArrayGroupMemberXid);
->>>>>>> REL_16_9
/* Move to next proc in list. */
nextidx = pg_atomic_read_u32(&nextproc->procArrayGroupNext);
@@ -1322,13 +1299,8 @@ ProcArrayApplyRecoveryInfo(RunningTransactions running)
*
* We have to sort them logically, because in
KnownAssignedXidsAdd we
* call TransactionIdFollowsOrEquals and so on. But we know
these XIDs
-<<<<<<< HEAD
- * come from RUNNING_XACTS, which means there are only normal
XIDs from
- * the same epoch, so this is safe.
-=======
* come from RUNNING_XACTS, which means there are only normal
XIDs
* from the same epoch, so this is safe.
->>>>>>> REL_16_9
*/
qsort(xids, nxids, sizeof(TransactionId), xidLogicalComparator);
@@ -2041,40 +2013,11 @@ ComputeXidHorizons(ComputeXidHorizonsResult *h, bool
updateGlobalVis)
TransactionIdOlder(h->data_oldest_nonremovable, kaxmin);
/* temp relations cannot be accessed in recovery */
}
-<<<<<<< HEAD
- else
- {
- /*
- * Compute the cutoff XID by subtracting
vacuum_defer_cleanup_age.
- *
- * vacuum_defer_cleanup_age provides some additional "slop" for
the
- * benefit of hot standby queries on standby servers. This is
quick
- * and dirty, and perhaps not all that useful unless the
primary has a
- * predictable transaction rate, but it offers some protection
when
- * there's no walsender connection. Note that we are assuming
- * vacuum_defer_cleanup_age isn't large enough to cause
wraparound ---
- * so guc.c should limit it to no more than the xidStopLimit
threshold
- * in varsup.c. Also note that we intentionally don't apply
- * vacuum_defer_cleanup_age on standby servers.
- */
- h->oldest_considered_running =
- TransactionIdRetreatedBy(h->oldest_considered_running,
-
vacuum_defer_cleanup_age);
- h->shared_oldest_nonremovable =
- TransactionIdRetreatedBy(h->shared_oldest_nonremovable,
-
vacuum_defer_cleanup_age);
- h->data_oldest_nonremovable =
- TransactionIdRetreatedBy(h->data_oldest_nonremovable,
-
vacuum_defer_cleanup_age);
- /* defer doesn't apply to temp relations */
- }
-=======
Assert(TransactionIdPrecedesOrEquals(h->oldest_considered_running,
h->shared_oldest_nonremovable));
Assert(TransactionIdPrecedesOrEquals(h->shared_oldest_nonremovable,
h->data_oldest_nonremovable));
->>>>>>> REL_16_9
/*
* Check whether there are replication slots requiring an older xmin.
@@ -2258,7 +2201,6 @@ GetOldestNonRemovableTransactionId(Relation rel)
TransactionId result;
result = GetLocalOldestNonRemovableTransactionId(rel, true);
-<<<<<<< HEAD
/*
* In QD node, all distributed transactions have an entry in the proc
array,
* so we're done.
@@ -2276,24 +2218,6 @@ GetOldestNonRemovableTransactionId(Relation rel)
result = DistributedLog_GetOldestXmin(result);
return result;
-=======
- ComputeXidHorizons(&horizons);
-
- switch (GlobalVisHorizonKindForRel(rel))
- {
- case VISHORIZON_SHARED:
- return horizons.shared_oldest_nonremovable;
- case VISHORIZON_CATALOG:
- return horizons.catalog_oldest_nonremovable;
- case VISHORIZON_DATA:
- return horizons.data_oldest_nonremovable;
- case VISHORIZON_TEMP:
- return horizons.temp_oldest_nonremovable;
- }
-
- /* just to prevent compiler warnings */
- return InvalidTransactionId;
->>>>>>> REL_16_9
}
/*
@@ -2994,10 +2918,7 @@ GetSnapshotData(Snapshot snapshot, DtxContext
distributedTransactionContext)
TransactionId *other_xids = ProcGlobal->xids;
TransactionId xmin;
TransactionId xmax;
-<<<<<<< HEAD
TransactionId globalxmin;
-=======
->>>>>>> REL_16_9
int count = 0;
int subcount = 0;
bool suboverflowed = false;
@@ -3405,13 +3326,6 @@ GetSnapshotData(Snapshot snapshot, DtxContext
distributedTransactionContext)
*/
oldestfxid = FullXidRelativeTo(latest_completed, oldestxid);
-<<<<<<< HEAD
- /* apply vacuum_defer_cleanup_age */
- def_vis_xid_data =
- TransactionIdRetreatedBy(globalxmin,
vacuum_defer_cleanup_age);
-
-=======
->>>>>>> REL_16_9
/* Check whether there's a replication slot requiring an older
xmin. */
def_vis_xid_data =
TransactionIdOlder(xmin, replication_slot_xmin);
@@ -4025,30 +3939,12 @@ GetOldestSafeDecodingTransactionId(bool catalogOnly)
* actions in progress.
*
* Constructs an array of VXIDs of transactions that are currently in commit
-<<<<<<< HEAD
- * critical sections, as shown by having delayChkpt or delayChkptEnd set in
- * their PGPROC.
-=======
* critical sections, as shown by having specified delayChkptFlags bits set
* in their PGPROC.
->>>>>>> REL_16_9
*
* Returns a palloc'd array that should be freed by the caller.
* *nvxids is the number of valid entries.
*
-<<<<<<< HEAD
- * Note that because backends set or clear delayChkpt and delayChkptEnd
- * without holding any lock, the result is somewhat indeterminate, but we
- * don't really care. Even in a multiprocessor with delayed writes to
- * shared memory, it should be certain that setting of delayChkpt will
- * propagate to shared memory when the backend takes a lock, so we cannot
- * fail to see a virtual xact as delayChkpt if it's already inserted its
- * commit record. Whether it takes a little while for clearing of
- * delayChkpt to propagate is unimportant for correctness.
- */
-static VirtualTransactionId *
-GetVirtualXIDsDelayingChkptGuts(int *nvxids, int type)
-=======
* Note that because backends set or clear delayChkptFlags without holding any
* lock, the result is somewhat indeterminate, but we don't really care. Even
* in a multiprocessor with delayed writes to shared memory, it should be
@@ -4060,7 +3956,6 @@ GetVirtualXIDsDelayingChkptGuts(int *nvxids, int type)
*/
VirtualTransactionId *
GetVirtualXIDsDelayingChkpt(int *nvxids, int type)
->>>>>>> REL_16_9
{
VirtualTransactionId *vxids;
ProcArrayStruct *arrayP = procArray;
@@ -4080,12 +3975,7 @@ GetVirtualXIDsDelayingChkpt(int *nvxids, int type)
int pgprocno = arrayP->pgprocnos[index];
PGPROC *proc = &allProcs[pgprocno];
-<<<<<<< HEAD
- if (((type & DELAY_CHKPT_START) && proc->delayChkpt) ||
- ((type & DELAY_CHKPT_COMPLETE) && proc->delayChkptEnd))
-=======
if ((proc->delayChkptFlags & type) != 0)
->>>>>>> REL_16_9
{
VirtualTransactionId vxid;
@@ -4101,26 +3991,6 @@ GetVirtualXIDsDelayingChkpt(int *nvxids, int type)
return vxids;
}
-/*
- * GetVirtualXIDsDelayingChkpt - Get the VXIDs of transactions that are
- * delaying the start of a checkpoint.
- */
-VirtualTransactionId *
-GetVirtualXIDsDelayingChkpt(int *nvxids)
-{
- return GetVirtualXIDsDelayingChkptGuts(nvxids, DELAY_CHKPT_START);
-}
-
-/*
- * GetVirtualXIDsDelayingChkptEnd - Get the VXIDs of transactions that are
- * delaying the end of a checkpoint.
- */
-VirtualTransactionId *
-GetVirtualXIDsDelayingChkptEnd(int *nvxids)
-{
- return GetVirtualXIDsDelayingChkptGuts(nvxids, DELAY_CHKPT_COMPLETE);
-}
-
/*
* HaveVirtualXIDsDelayingChkpt -- Are any of the specified VXIDs delaying?
*
@@ -4130,14 +4000,8 @@ GetVirtualXIDsDelayingChkptEnd(int *nvxids)
* Note: this is O(N^2) in the number of vxacts that are/were delaying, but
* those numbers should be small enough for it not to be a problem.
*/
-<<<<<<< HEAD
-static bool
-HaveVirtualXIDsDelayingChkptGuts(VirtualTransactionId *vxids, int nvxids,
- int type)
-=======
bool
HaveVirtualXIDsDelayingChkpt(VirtualTransactionId *vxids, int nvxids, int type)
->>>>>>> REL_16_9
{
bool result = false;
ProcArrayStruct *arrayP = procArray;
@@ -4155,12 +4019,7 @@ HaveVirtualXIDsDelayingChkpt(VirtualTransactionId
*vxids, int nvxids, int type)
GET_VXID_FROM_PGPROC(vxid, *proc);
-<<<<<<< HEAD
- if ((((type & DELAY_CHKPT_START) && proc->delayChkpt) ||
- ((type & DELAY_CHKPT_COMPLETE) &&
proc->delayChkptEnd)) &&
-=======
if ((proc->delayChkptFlags & type) != 0 &&
->>>>>>> REL_16_9
VirtualTransactionIdIsValid(vxid))
{
int i;
@@ -5680,21 +5539,6 @@ ExpireAllKnownAssignedTransactionIds(void)
LWLockAcquire(ProcArrayLock, LW_EXCLUSIVE);
KnownAssignedXidsRemovePreceding(InvalidTransactionId);
-<<<<<<< HEAD
-=======
- /* Reset latestCompletedXid to nextXid - 1 */
- Assert(FullTransactionIdIsValid(ShmemVariableCache->nextXid));
- latestXid = ShmemVariableCache->nextXid;
- FullTransactionIdRetreat(&latestXid);
- ShmemVariableCache->latestCompletedXid = latestXid;
-
- /*
- * Any transactions that were in-progress were effectively aborted, so
- * advance xactCompletionCount.
- */
- ShmemVariableCache->xactCompletionCount++;
-
->>>>>>> REL_16_9
/*
* Reset lastOverflowedXid. Currently, lastOverflowedXid has no use
after
* the call of this function. But do this for unification with what
@@ -5716,17 +5560,6 @@ ExpireOldKnownAssignedTransactionIds(TransactionId xid)
LWLockAcquire(ProcArrayLock, LW_EXCLUSIVE);
-<<<<<<< HEAD
-=======
- /* As in ProcArrayEndTransaction, advance latestCompletedXid */
- latestXid = xid;
- TransactionIdRetreat(latestXid);
- MaintainLatestCompletedXidRecovery(latestXid);
-
- /* ... and xactCompletionCount */
- ShmemVariableCache->xactCompletionCount++;
-
->>>>>>> REL_16_9
/*
* Reset lastOverflowedXid if we know all transactions that have been
* possibly running are being gone. Not doing so could cause an
incorrect
diff --git a/src/backend/storage/ipc/procsignal.c
b/src/backend/storage/ipc/procsignal.c
index ac0ccbd912c..80f5452dbc3 100644
--- a/src/backend/storage/ipc/procsignal.c
+++ b/src/backend/storage/ipc/procsignal.c
@@ -22,11 +22,8 @@
#include "commands/async.h"
#include "miscadmin.h"
#include "pgstat.h"
-<<<<<<< HEAD
#include "postmaster/loginmonitor.h"
-=======
#include "replication/logicalworker.h"
->>>>>>> REL_16_9
#include "replication/walsender.h"
#include "storage/condition_variable.h"
#include "storage/ipc.h"
diff --git a/src/backend/storage/ipc/shm_mq.c b/src/backend/storage/ipc/shm_mq.c
index 38d086337eb..4cf9d80ca03 100644
--- a/src/backend/storage/ipc/shm_mq.c
+++ b/src/backend/storage/ipc/shm_mq.c
@@ -985,16 +985,14 @@ shm_mq_send_bytes(shm_mq_handle *mqh, Size nbytes, const
void *data,
}
else if (available == 0)
{
-<<<<<<< HEAD
if (QueryFinishPending)
{
*bytes_written = sent;
return SHM_MQ_QUERY_FINISH;
}
-=======
+
/* Update the pending send bytes in the shared memory.
*/
shm_mq_inc_bytes_written(mq, mqh->mqh_send_pending);
->>>>>>> REL_16_9
/*
* Since mq->mqh_counterparty_attached is known to be
true at this
diff --git a/src/backend/storage/ipc/sinval.c b/src/backend/storage/ipc/sinval.c
index 3e0e881fb4c..e129d94457a 100644
--- a/src/backend/storage/ipc/sinval.c
+++ b/src/backend/storage/ipc/sinval.c
@@ -231,14 +231,8 @@ ProcessCatchupInterrupt(void)
StartTransactionCommand();
CommitTransactionCommand();
-<<<<<<< HEAD
setDistributedTransactionContext(saveDistributedTransactionContext);
-=======
- /* Caller's context had better not have been
transaction-local */
- Assert(MemoryContextIsValid(oldcontext));
- MemoryContextSwitchTo(oldcontext);
->>>>>>> REL_16_9
}
in_process_catchup_event = 0;
diff --git a/src/backend/storage/ipc/standby.c
b/src/backend/storage/ipc/standby.c
index 1a68c163657..3bdc5f7fb6c 100644
--- a/src/backend/storage/ipc/standby.c
+++ b/src/backend/storage/ipc/standby.c
@@ -1035,19 +1035,11 @@ StandbyAcquireAccessExclusiveLock(TransactionId xid,
Oid dbOid, Oid relOid)
static void
StandbyReleaseXidEntryLocks(RecoveryLockXidEntry *xidentry)
{
-<<<<<<< HEAD
- ListCell *lc;
-
- foreach(lc, locks)
- {
- xl_standby_lock *lock = (xl_standby_lock *) lfirst(lc);
-=======
RecoveryLockEntry *entry;
RecoveryLockEntry *next;
for (entry = xidentry->head; entry != NULL; entry = next)
{
->>>>>>> REL_16_9
LOCKTAG locktag;
elog(trace_recovery(DEBUG4),
@@ -1062,18 +1054,12 @@ StandbyReleaseXidEntryLocks(RecoveryLockXidEntry
*xidentry)
entry->key.xid, entry->key.dbOid,
entry->key.relOid);
Assert(false);
}
-<<<<<<< HEAD
- }
-
- list_free_deep(locks);
-=======
/* ... and remove the per-lock hash entry */
next = entry->next;
hash_search(RecoveryLockHash, entry, HASH_REMOVE, NULL);
}
xidentry->head = NULL; /* just for paranoia */
->>>>>>> REL_16_9
}
/*
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]