aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Riggs <simon@2ndQuadrant.com>2010-11-15 09:30:13 +0000
committerSimon Riggs <simon@2ndQuadrant.com>2010-11-15 09:30:13 +0000
commit52010027efc8757fdd830a4d0113763a501259bc (patch)
treee502a06d18bdd826e9634697fe9ca8e6dccc1b65
parent357edc9a9952582c510cff1b08ebc5fd8df81a3b (diff)
downloadpostgresql-52010027efc8757fdd830a4d0113763a501259bc.tar.gz
postgresql-52010027efc8757fdd830a4d0113763a501259bc.zip
Avoid spurious Hot Standby conflicts from btree delete records.
Similar conflicts were already avoided for related record types. Massive over-caution resulted in a usability bug. Clear theoretical basis for doing this is now confirmed by me. Request to remove from Heikki (twice), over-caution by me.
-rw-r--r--src/backend/storage/ipc/standby.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/src/backend/storage/ipc/standby.c b/src/backend/storage/ipc/standby.c
index 4d00fb651e4..82da9261566 100644
--- a/src/backend/storage/ipc/standby.c
+++ b/src/backend/storage/ipc/standby.c
@@ -266,21 +266,13 @@ ResolveRecoveryConflictWithSnapshot(TransactionId latestRemovedXid, RelFileNode
/*
* If we get passed InvalidTransactionId then we are a little surprised,
- * but it is theoretically possible, so spit out a DEBUG1 message, but not
- * one that needs translating.
- *
- * We grab latestCompletedXid instead because this is the very latest
- * value it could ever be.
+ * but it is theoretically possible in normal running. It also happens
+ * when replaying already applied WAL records after a standby crash or
+ * restart. If latestRemovedXid is invalid then there is no conflict. That
+ * rule applies across all record types that suffer from this conflict.
*/
if (!TransactionIdIsValid(latestRemovedXid))
- {
- elog(DEBUG1, "invalid latestremovexXid reported, using latestcompletedxid instead");
-
- LWLockAcquire(ProcArrayLock, LW_SHARED);
- latestRemovedXid = ShmemVariableCache->latestCompletedXid;
- LWLockRelease(ProcArrayLock);
- }
- Assert(TransactionIdIsValid(latestRemovedXid));
+ return;
backends = GetConflictingVirtualXIDs(latestRemovedXid,
node.dbNode);