Skip to content

Commit d21ad66

Browse files
committed
Change DtmAdjustOldestXid
1 parent f9a1b2a commit d21ad66

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

pg_dtm.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,10 @@ static TransactionId DtmAdjustOldestXid(TransactionId xid)
393393
DtmTransStatus *ts, *prev = NULL;
394394
timestamp_t cutoff_time = dtm_get_current_time() - DtmVacuumDelay*USEC;
395395
SpinLockAcquire(&local->lock);
396+
ts = (DtmTransStatus*)hash_search(xid2status, &xid, HASH_FIND, NULL);
397+
if (ts != NULL) {
398+
cutoff_time = ts->cid - DtmVacuumDelay*USEC;
399+
}
396400
for (ts = local->trans_list_head; ts != NULL && ts->cid < cutoff_time; prev = ts, ts = ts->next) {
397401
if (prev != NULL) {
398402
hash_search(xid2status, &prev->xid, HASH_REMOVE, NULL);

tests/deploy/cluster.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
pg_destroy_and_init: true
1212
pg_datadir: ./postgrespro-data
1313
pg_config_role:
14-
- line: "dtm.vacuum_delay=10"
14+
- line: "dtm.vacuum_delay=60"
1515

1616
tasks:
1717

0 commit comments

Comments
 (0)