Skip to content

Commit 05af1db

Browse files
committed
merge
2 parents d7a3b4c + 8f07060 commit 05af1db

File tree

2 files changed

+20
-17
lines changed

2 files changed

+20
-17
lines changed

contrib/mmts/pglogical_proto.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,12 @@ pglogical_write_rel(StringInfo out, PGLogicalOutputData *data, Relation rel)
7777
Oid relid;
7878

7979
if (MtmTransactionSnapshot(MtmCurrentXid) == INVALID_CSN) {
80-
MTM_LOG1("%d: pglogical_write_message filtered", MyProcPid);
80+
MTM_LOG2("%d: pglogical_write_message filtered", MyProcPid);
8181
return;
8282
}
8383

8484
if (DDLInProress) {
85-
MTM_LOG1("%d: pglogical_write_message filtered DDLInProress", MyProcPid);
85+
MTM_LOG2("%d: pglogical_write_message filtered DDLInProress", MyProcPid);
8686
return;
8787
}
8888

@@ -141,7 +141,7 @@ pglogical_write_message(StringInfo out,
141141
{
142142
if (MtmTransactionSnapshot(MtmCurrentXid) == INVALID_CSN)
143143
{
144-
MTM_LOG1("%d: pglogical_write_message filtered", MyProcPid);
144+
MTM_LOG2("%d: pglogical_write_message filtered", MyProcPid);
145145
return;
146146
}
147147
DDLInProress = true;
@@ -263,12 +263,12 @@ pglogical_write_insert(StringInfo out, PGLogicalOutputData *data,
263263
Relation rel, HeapTuple newtuple)
264264
{
265265
if (MtmTransactionSnapshot(MtmCurrentXid) == INVALID_CSN){
266-
MTM_LOG1("%d: pglogical_write_insert filtered", MyProcPid);
266+
MTM_LOG2("%d: pglogical_write_insert filtered", MyProcPid);
267267
return;
268268
}
269269

270270
if (DDLInProress) {
271-
MTM_LOG1("%d: pglogical_write_insert filtered DDLInProress", MyProcPid);
271+
MTM_LOG2("%d: pglogical_write_insert filtered DDLInProress", MyProcPid);
272272
return;
273273
}
274274

@@ -286,12 +286,12 @@ pglogical_write_update(StringInfo out, PGLogicalOutputData *data,
286286
Relation rel, HeapTuple oldtuple, HeapTuple newtuple)
287287
{
288288
if (MtmTransactionSnapshot(MtmCurrentXid) == INVALID_CSN){
289-
MTM_LOG1("%d: pglogical_write_update filtered", MyProcPid);
289+
MTM_LOG2("%d: pglogical_write_update filtered", MyProcPid);
290290
return;
291291
}
292292

293293
if (DDLInProress) {
294-
MTM_LOG1("%d: pglogical_write_update filtered DDLInProress", MyProcPid);
294+
MTM_LOG2("%d: pglogical_write_update filtered DDLInProress", MyProcPid);
295295
return;
296296
}
297297

@@ -319,12 +319,12 @@ pglogical_write_delete(StringInfo out, PGLogicalOutputData *data,
319319
Relation rel, HeapTuple oldtuple)
320320
{
321321
if (MtmTransactionSnapshot(MtmCurrentXid) == INVALID_CSN){
322-
MTM_LOG1("%d: pglogical_write_delete filtered", MyProcPid);
322+
MTM_LOG2("%d: pglogical_write_delete filtered", MyProcPid);
323323
return;
324324
}
325325

326326
if (DDLInProress) {
327-
MTM_LOG1("%d: pglogical_write_delete filtered DDLInProress", MyProcPid);
327+
MTM_LOG2("%d: pglogical_write_delete filtered DDLInProress", MyProcPid);
328328
return;
329329
}
330330

@@ -356,12 +356,12 @@ pglogical_write_tuple(StringInfo out, PGLogicalOutputData *data,
356356
uint16 nliveatts = 0;
357357

358358
if (MtmTransactionSnapshot(MtmCurrentXid) == INVALID_CSN){
359-
MTM_LOG1("%d: pglogical_write_tuple filtered", MyProcPid);
359+
MTM_LOG2("%d: pglogical_write_tuple filtered", MyProcPid);
360360
return;
361361
}
362362

363363
if (DDLInProress) {
364-
MTM_LOG1("%d: pglogical_write_tuple filtered DDLInProress", MyProcPid);
364+
MTM_LOG2("%d: pglogical_write_tuple filtered DDLInProress", MyProcPid);
365365
return;
366366
}
367367

src/backend/utils/time/tqual.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -989,8 +989,9 @@ HeapTupleSatisfiesMVCC(HeapTuple htup, Snapshot snapshot,
989989
{
990990
if (TransactionIdDidCommit(xvac))
991991
{
992-
SetHintBits(tuple, buffer, HEAP_XMIN_INVALID,
993-
InvalidTransactionId);
992+
if (!TransactionIdIsInProgress(xvac))
993+
SetHintBits(tuple, buffer, HEAP_XMIN_INVALID,
994+
InvalidTransactionId);
994995
return false;
995996
}
996997
SetHintBits(tuple, buffer, HEAP_XMIN_COMMITTED,
@@ -1011,8 +1012,9 @@ HeapTupleSatisfiesMVCC(HeapTuple htup, Snapshot snapshot,
10111012
InvalidTransactionId);
10121013
else
10131014
{
1014-
SetHintBits(tuple, buffer, HEAP_XMIN_INVALID,
1015-
InvalidTransactionId);
1015+
if (!TransactionIdIsInProgress(xvac))
1016+
SetHintBits(tuple, buffer, HEAP_XMIN_INVALID,
1017+
InvalidTransactionId);
10161018
return false;
10171019
}
10181020
}
@@ -1067,8 +1069,9 @@ HeapTupleSatisfiesMVCC(HeapTuple htup, Snapshot snapshot,
10671069
else
10681070
{
10691071
/* it must have aborted or crashed */
1070-
SetHintBits(tuple, buffer, HEAP_XMIN_INVALID,
1071-
InvalidTransactionId);
1072+
if (!TransactionIdIsInProgress(HeapTupleHeaderGetRawXmin(tuple)))
1073+
SetHintBits(tuple, buffer, HEAP_XMIN_INVALID,
1074+
InvalidTransactionId);
10721075
return false;
10731076
}
10741077
}

0 commit comments

Comments
 (0)