Skip to content

Commit b41303d

Browse files
committed
Fix MtmAdjustOldestXid
1 parent 7d2a44e commit b41303d

File tree

3 files changed

+53
-10
lines changed

3 files changed

+53
-10
lines changed

contrib/mmts/multimaster.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ MtmAdjustOldestXid(TransactionId xid)
487487
static TransactionId
488488
MtmAdjustOldestXid(TransactionId xid)
489489
{
490-
if (TransactionIdIsValid(xid) && MtmUseDtm) {
490+
if (TransactionIdIsValid(xid)) {
491491
MtmTransState *ts, *prev = NULL;
492492
int i;
493493

@@ -518,13 +518,15 @@ MtmAdjustOldestXid(TransactionId xid)
518518
hash_search(MtmXid2State, &prev->xid, HASH_REMOVE, NULL);
519519
}
520520
}
521-
}
522-
if (prev != NULL) {
523-
Mtm->transListHead = prev;
524-
Mtm->oldestXid = xid = prev->xid;
525-
} else if (TransactionIdPrecedes(Mtm->oldestXid, xid)) {
526-
xid = Mtm->oldestXid;
527-
}
521+
}
522+
if (MtmUseDtm) {
523+
if (prev != NULL) {
524+
Mtm->transListHead = prev;
525+
Mtm->oldestXid = xid = prev->xid;
526+
} else if (TransactionIdPrecedes(Mtm->oldestXid, xid)) {
527+
xid = Mtm->oldestXid;
528+
}
529+
}
528530
MtmUnlock();
529531
}
530532
return xid;

contrib/mmts/tests/deploy_layouts/cluster.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@
4646
- "wal_sender_timeout = 0"
4747
- "max_replication_slots = 10"
4848
- "max_connections = 200"
49-
- "max_worker_processes = 100"
49+
- "max_worker_processes = 200"
5050
- "shared_preload_libraries = 'raftable,multimaster'"
5151
- "multimaster.conn_strings = '{{connections}}'"
5252
- "multimaster.node_id = {{ node_id }}"
5353
- "multimaster.buffer_size = 65536"
5454
- "multimaster.queue_size = 1073741824"
5555
- "multimaster.arbiter_port = 5600"
5656
- "multimaster.vacuum_delay = 1"
57-
- "multimaster.workers = 32"
57+
- "multimaster.workers = 100"
5858
- "multimaster.use_dtm = 0"
5959

6060
- name: restart postgrespro

contrib/mmts/tests/perf.results

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,3 +151,44 @@ Bench finished at Ср. апр. 13 14:14:56 MSK 2016
151151
Bench started at Ср. апр. 13 14:23:33 MSK 2016
152152
astro5:{tps:16078.719352, transactions:1000000, selects:0, updates:2000802, aborts:788, abort_percent: 0, readers:0, writers:100, update_percent:100, accounts:500000, iterations:10000, hosts:3}
153153
Bench finished at Ср. апр. 13 14:24:36 MSK 2016
154+
Bench started at Ср. апр. 13 14:56:01 MSK 2016
155+
astro5:{tps:19270.176742, transactions:1000000, selects:0, updates:2000712, aborts:1057, abort_percent: 0, readers:0, writers:100, update_percent:100, accounts:500000, iterations:10000, hosts:3}
156+
Bench finished at Ср. апр. 13 14:56:53 MSK 2016
157+
Bench started at Ср. апр. 13 14:57:38 MSK 2016
158+
astro5:{tps:118537.540721, transactions:1000000, selects:2000000, updates:0, aborts:0, abort_percent: 0, readers:0, writers:100, update_percent:0, accounts:500000, iterations:10000, hosts:3}
159+
Bench finished at Ср. апр. 13 14:57:47 MSK 2016
160+
Bench started at Ср. апр. 13 14:58:18 MSK 2016
161+
astro5:{tps:19246.519176, transactions:1000000, selects:0, updates:2000774, aborts:1053, abort_percent: 0, readers:0, writers:100, update_percent:100, accounts:500000, iterations:10000, hosts:3}
162+
Bench finished at Ср. апр. 13 14:59:10 MSK 2016
163+
Bench started at Ср. апр. 13 15:06:25 MSK 2016
164+
astro5:{tps:18571.114322, transactions:1000000, selects:0, updates:2000840, aborts:865, abort_percent: 0, readers:0, writers:100, update_percent:100, accounts:500000, iterations:10000, hosts:3}
165+
Bench finished at Ср. апр. 13 15:07:19 MSK 2016
166+
Bench started at Ср. апр. 13 15:07:51 MSK 2016
167+
astro5:{tps:116649.799106, transactions:1000000, selects:2000000, updates:0, aborts:0, abort_percent: 0, readers:0, writers:100, update_percent:0, accounts:500000, iterations:10000, hosts:3}
168+
Bench finished at Ср. апр. 13 15:08:00 MSK 2016
169+
Bench started at Ср. апр. 13 15:09:33 MSK 2016
170+
astro5:{tps:17636.360192, transactions:1000000, selects:0, updates:2000852, aborts:893, abort_percent: 0, readers:0, writers:100, update_percent:100, accounts:500000, iterations:10000, hosts:3}
171+
Bench finished at Ср. апр. 13 15:10:30 MSK 2016
172+
Bench started at Ср. апр. 13 18:17:09 MSK 2016
173+
astro5:{tps:118106.246182, transactions:10000000, selects:20000000, updates:0, aborts:0, abort_percent: 0, readers:0, writers:100, update_percent:0, accounts:500000, iterations:100000, hosts:3}
174+
Bench finished at Ср. апр. 13 18:18:34 MSK 2016
175+
Bench started at Ср. апр. 13 18:19:25 MSK 2016
176+
astro5:{tps:120241.087565, transactions:100000000, selects:200000000, updates:0, aborts:0, abort_percent: 0, readers:0, writers:100, update_percent:0, accounts:500000, iterations:1000000, hosts:3}
177+
Bench finished at Ср. апр. 13 18:33:17 MSK 2016
178+
Bench started at Ср. апр. 13 18:33:52 MSK 2016
179+
Bench started at Ср. апр. 13 19:35:23 MSK 2016
180+
181+
Bench finished at Ср. апр. 13 19:35:24 MSK 2016
182+
Bench started at Ср. апр. 13 19:35:44 MSK 2016
183+
Bench started at Чт. апр. 14 14:30:56 MSK 2016
184+
185+
Bench finished at Чт. апр. 14 14:30:57 MSK 2016
186+
Bench started at Чт. апр. 14 15:05:58 MSK 2016
187+
188+
Bench finished at Чт. апр. 14 15:05:59 MSK 2016
189+
Bench started at Чт. апр. 14 15:06:49 MSK 2016
190+
191+
Bench finished at Чт. апр. 14 15:57:08 MSK 2016
192+
Bench started at Чт. апр. 14 16:07:25 MSK 2016
193+
194+
Bench finished at Чт. апр. 14 16:58:03 MSK 2016

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