Skip to content

Commit c573948

Browse files
committed
Fix Copy statement
1 parent f2b73cd commit c573948

File tree

3 files changed

+63
-3
lines changed

3 files changed

+63
-3
lines changed

contrib/mmts/multimaster.c

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,8 @@ MtmAdjustOldestXid(TransactionId xid)
519519
}
520520
}
521521
}
522-
if (MtmUseDtm) {
522+
//if (MtmUseDtm)
523+
{
523524
if (prev != NULL) {
524525
Mtm->transListHead = prev;
525526
Mtm->oldestXid = xid = prev->xid;
@@ -2570,7 +2571,6 @@ static void MtmProcessUtility(Node *parsetree, const char *queryString,
25702571
case T_AlterTableSpaceOptionsStmt:
25712572
case T_TruncateStmt:
25722573
case T_CommentStmt: /* XXX: we could replicate these */;
2573-
case T_CopyStmt:
25742574
case T_PrepareStmt:
25752575
case T_ExecuteStmt:
25762576
case T_DeallocateStmt:
@@ -2678,6 +2678,29 @@ static void MtmProcessUtility(Node *parsetree, const char *queryString,
26782678
}
26792679
}
26802680
break;
2681+
case T_CopyStmt:
2682+
{
2683+
CopyStmt *copyStatement = (CopyStmt *) parsetree;
2684+
skipCommand = true;
2685+
if (copyStatement->is_from) {
2686+
RangeVar *relation = copyStatement->relation;
2687+
2688+
if (relation != NULL)
2689+
{
2690+
Oid relid = RangeVarGetRelid(relation, NoLock, true);
2691+
if (OidIsValid(relid))
2692+
{
2693+
Relation rel = heap_open(relid, ShareLock);
2694+
if (RelationNeedsWAL(rel)) {
2695+
MtmTx.containsDML = true;
2696+
}
2697+
heap_close(rel, ShareLock);
2698+
}
2699+
}
2700+
}
2701+
break;
2702+
}
2703+
26812704
default:
26822705
skipCommand = false;
26832706
break;

contrib/mmts/tests/deploy_layouts/cluster.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
- "multimaster.arbiter_port = 5600"
5656
- "multimaster.vacuum_delay = 1"
5757
- "multimaster.workers = 32"
58-
- "multimaster.use_dtm = 0"
58+
- "multimaster.use_dtm = 1"
5959

6060
- name: restart postgrespro
6161
command: "{{pg_dst}}/bin/pg_ctl restart -w -D {{pg_datadir}} -l {{pg_datadir}}/pg.log"

contrib/mmts/tests/perf.results

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,3 +291,40 @@ Bench finished at Чт. апр. 14 20:14:21 MSK 2016
291291
Bench started at Чт. апр. 14 20:14:46 MSK 2016
292292
astro5:{tps:11453.993709, transactions:1500000, selects:0, updates:3001960, aborts:2563, abort_percent: 0, readers:0, writers:150, update_percent:100, accounts:500000, iterations:10000, hosts:3}
293293
Bench finished at Чт. апр. 14 20:16:57 MSK 2016
294+
Bench started at Чт. апр. 14 20:22:40 MSK 2016
295+
Bench started at Пт. апр. 15 09:59:02 MSK 2016
296+
astro5:{tps:19157.887469, transactions:1500000, selects:0, updates:3001900, aborts:2466, abort_percent: 0, readers:0, writers:150, update_percent:100, accounts:500000, iterations:10000, hosts:3}
297+
Bench finished at Пт. апр. 15 10:00:20 MSK 2016
298+
Bench started at Пт. апр. 15 10:00:47 MSK 2016
299+
astro5:{tps:19393.531934, transactions:1500000, selects:0, updates:3001854, aborts:2486, abort_percent: 0, readers:0, writers:150, update_percent:100, accounts:500000, iterations:10000, hosts:3}
300+
Bench finished at Пт. апр. 15 10:02:04 MSK 2016
301+
Bench started at Пт. апр. 15 10:17:23 MSK 2016
302+
astro5:{tps:20665.868900, transactions:1500000, selects:0, updates:3001838, aborts:2422, abort_percent: 0, readers:0, writers:150, update_percent:100, accounts:500000, iterations:10000, hosts:3}
303+
Bench finished at Пт. апр. 15 10:18:36 MSK 2016
304+
Bench started at Пт. апр. 15 10:21:50 MSK 2016
305+
astro5:{tps:18643.610238, transactions:1500000, selects:0, updates:3001856, aborts:2431, abort_percent: 0, readers:0, writers:150, update_percent:100, accounts:500000, iterations:10000, hosts:3}
306+
Bench finished at Пт. апр. 15 10:23:11 MSK 2016
307+
Bench started at Пт. апр. 15 10:52:34 MSK 2016
308+
astro5:{tps:20520.642631, transactions:1500000, selects:0, updates:3001844, aborts:2421, abort_percent: 0, readers:0, writers:150, update_percent:100, accounts:500000, iterations:10000, hosts:3}
309+
Bench finished at Пт. апр. 15 10:53:48 MSK 2016
310+
Bench started at Пт. апр. 15 11:06:54 MSK 2016
311+
astro5:{tps:20158.824931, transactions:1500000, selects:0, updates:3001700, aborts:2392, abort_percent: 0, readers:0, writers:150, update_percent:100, accounts:500000, iterations:10000, hosts:3}
312+
Bench finished at Пт. апр. 15 11:08:10 MSK 2016
313+
Bench started at Пт. апр. 15 11:31:49 MSK 2016
314+
astro5:{tps:18980.574597, transactions:1000000, selects:0, updates:2000698, aborts:1019, abort_percent: 0, readers:0, writers:100, update_percent:100, accounts:500000, iterations:10000, hosts:3}
315+
Bench finished at Пт. апр. 15 11:32:42 MSK 2016
316+
Bench started at Пт. апр. 15 11:33:11 MSK 2016
317+
astro5:{tps:19746.702465, transactions:1500000, selects:0, updates:3001724, aborts:2315, abort_percent: 0, readers:0, writers:150, update_percent:100, accounts:500000, iterations:10000, hosts:3}
318+
Bench finished at Пт. апр. 15 11:34:27 MSK 2016
319+
Bench started at Пт. апр. 15 11:52:43 MSK 2016
320+
astro5:{tps:20725.160946, transactions:1500000, selects:0, updates:3001710, aborts:2348, abort_percent: 0, readers:0, writers:150, update_percent:100, accounts:500000, iterations:10000, hosts:3}
321+
Bench finished at Пт. апр. 15 11:53:55 MSK 2016
322+
Bench started at Пт. апр. 15 11:55:32 MSK 2016
323+
astro5:{tps:64193.925226, transactions:1500000, selects:3000000, updates:0, aborts:0, abort_percent: 0, readers:0, writers:150, update_percent:0, accounts:500000, iterations:10000, hosts:1}
324+
Bench finished at Пт. апр. 15 11:55:56 MSK 2016
325+
Bench started at Пт. апр. 15 11:56:33 MSK 2016
326+
astro5:{tps:124840.952626, transactions:1500000, selects:3000000, updates:0, aborts:0, abort_percent: 0, readers:0, writers:150, update_percent:0, accounts:500000, iterations:10000, hosts:3}
327+
Bench finished at Пт. апр. 15 11:56:45 MSK 2016
328+
Bench started at Пт. апр. 15 18:41:39 MSK 2016
329+
astro5:{tps:17367.895646, transactions:1500000, selects:0, updates:3002062, aborts:1968, abort_percent: 0, readers:0, writers:150, update_percent:100, accounts:500000, iterations:10000, hosts:3}
330+
Bench finished at Пт. апр. 15 18:43:05 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