Skip to content

Commit 1fe0f5b

Browse files
committed
Temporary disable in-progress check for setting tuple hint bits
1 parent 20afa29 commit 1fe0f5b

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

contrib/mmts/multimaster.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ typedef enum
101101
#define MTM_MAP_SIZE MTM_HASH_SIZE
102102
#define MIN_WAIT_TIMEOUT 1000
103103
#define MAX_WAIT_TIMEOUT 100000
104-
#define MAX_WAIT_LOOPS 100 // 1000000
104+
#define MAX_WAIT_LOOPS 10000 // 1000000
105105
#define STATUS_POLL_DELAY USECS_PER_SEC
106106

107107
void _PG_init(void);
@@ -2913,6 +2913,7 @@ void MtmDropNode(int nodeId, bool dropSlot)
29132913

29142914
MtmUnlock();
29152915
}
2916+
29162917
static void
29172918
MtmOnProcExit(int code, Datum arg)
29182919
{
@@ -3076,9 +3077,7 @@ void MtmSetupReplicationHooks(struct PGLogicalHooks* hooks)
30763077

30773078
void MtmBeginSession(int nodeId)
30783079
{
3079-
char slot_name[MULTIMASTER_MAX_SLOT_NAME_SIZE];
30803080
MtmLockNode(nodeId, LW_EXCLUSIVE);
3081-
sprintf(slot_name, MULTIMASTER_SLOT_PATTERN, nodeId);
30823081
Assert(replorigin_session_origin == InvalidRepOriginId);
30833082
replorigin_session_origin = Mtm->nodes[nodeId-1].originId;
30843083
Assert(replorigin_session_origin != InvalidRepOriginId);

contrib/mmts/pglogical_apply.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,14 @@ process_remote_commit(StringInfo in)
602602

603603
origin_node = pq_getmsgbyte(in);
604604
origin_lsn = pq_getmsgint64(in);
605-
Mtm->nodes[origin_node-1].restartLsn = origin_lsn;
605+
606+
if (Mtm->nodes[origin_node-1].restartLsn < origin_lsn) {
607+
Mtm->nodes[origin_node-1].restartLsn = origin_lsn;
608+
}
609+
if (origin_node != MtmReplicationNodeId) {
610+
replorigin_advance(Mtm->nodes[origin_node-1].originId, origin_lsn, GetXLogInsertRecPtr(),
611+
false /* backward */ , false /* WAL */ );
612+
}
606613

607614
Assert(replorigin_session_origin == InvalidRepOriginId);
608615

contrib/mmts/tests/run.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
./dtmbench \
2-
-c "dbname=postgres host=localhost port=5432 sslmode=disable" \
3-
-c "dbname=postgres host=localhost port=5433 sslmode=disable" \
4-
-c "dbname=postgres host=localhost port=5434 sslmode=disable" \
2+
-c "dbname=regression host=localhost port=5432 sslmode=disable" \
3+
-c "dbname=regression host=localhost port=5433 sslmode=disable" \
4+
-c "dbname=regression host=localhost port=5434 sslmode=disable" \
55
-n 1000 -a 1000 -w 10 -r 1 $*

src/backend/utils/time/tqual.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,7 +1065,7 @@ HeapTupleSatisfiesMVCC(HeapTuple htup, Snapshot snapshot,
10651065
else
10661066
{
10671067
/* it must have aborted or crashed */
1068-
if (!TransactionIdIsInProgress(HeapTupleHeaderGetRawXmin(tuple)))
1068+
//if (!TransactionIdIsInProgress(HeapTupleHeaderGetRawXmin(tuple)))
10691069
SetHintBits(tuple, buffer, HEAP_XMIN_INVALID,
10701070
InvalidTransactionId);
10711071
return false;
@@ -1130,7 +1130,7 @@ HeapTupleSatisfiesMVCC(HeapTuple htup, Snapshot snapshot,
11301130
if (!TransactionIdDidCommit(HeapTupleHeaderGetRawXmax(tuple)))
11311131
{
11321132
/* it must have aborted or crashed */
1133-
if (!TransactionIdIsInProgress(HeapTupleHeaderGetRawXmax(tuple)))
1133+
//if (!TransactionIdIsInProgress(HeapTupleHeaderGetRawXmax(tuple)))
11341134
SetHintBits(tuple, buffer, HEAP_XMAX_INVALID,
11351135
InvalidTransactionId);
11361136
return true;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy