|
16 | 16 | importsubprocess
|
17 | 17 | importthreading
|
18 | 18 |
|
19 |
| -fromtestgresimportget_new_node,stop_all |
| 19 | +fromtestgresimportget_new_node,stop_all,get_config |
20 | 20 |
|
| 21 | +version=get_config().get("VERSION_NUM") |
21 | 22 |
|
22 | 23 | # Helper function for json equality
|
23 | 24 | defordered(obj):
|
@@ -68,11 +69,17 @@ def init_test_data(self, node):
|
68 | 69 |
|
69 | 70 | defcatchup_replica(self,master,replica):
|
70 | 71 | """Wait until replica synchronizes with master"""
|
71 |
| -master.poll_query_until( |
72 |
| -'postgres', |
73 |
| -'SELECT pg_current_xlog_location() <= replay_location ' |
74 |
| -'FROM pg_stat_replication WHERE application_name =\'%s\'' |
75 |
| -%replica.name) |
| 72 | +ifversion>=100000: |
| 73 | +wait_lsn_query= \ |
| 74 | +'SELECT pg_current_wal_lsn() <= replay_lsn ' \ |
| 75 | +'FROM pg_stat_replication WHERE application_name =\'%s\'' \ |
| 76 | +%replica.name |
| 77 | +else: |
| 78 | +wait_lsn_query= \ |
| 79 | +'SELECT pg_current_xlog_location() <= replay_location ' \ |
| 80 | +'FROM pg_stat_replication WHERE application_name =\'%s\'' \ |
| 81 | +%replica.name |
| 82 | +master.poll_query_until('postgres',wait_lsn_query) |
76 | 83 |
|
77 | 84 | defprintlog(self,logfile):
|
78 | 85 | withopen(logfile,'r')aslog:
|
@@ -482,7 +489,6 @@ def test_parallel_nodes(self):
|
482 | 489 |
|
483 | 490 | # Check version of postgres server
|
484 | 491 | # If version < 9.6 skip all tests for parallel queries
|
485 |
| -version=int(node.psql("postgres","show server_version_num")[1]) |
486 | 492 | ifversion<90600:
|
487 | 493 | return
|
488 | 494 |
|
@@ -512,7 +518,10 @@ def test_parallel_nodes(self):
|
512 | 518 | # Test parallel select
|
513 | 519 | withnode.connect()ascon:
|
514 | 520 | con.execute('set max_parallel_workers_per_gather = 2')
|
515 |
| -con.execute('set min_parallel_relation_size = 0') |
| 521 | +ifversion>=100000: |
| 522 | +con.execute('set min_parallel_table_scan_size = 0') |
| 523 | +else: |
| 524 | +con.execute('set min_parallel_relation_size = 0') |
516 | 525 | con.execute('set parallel_setup_cost = 0')
|
517 | 526 | con.execute('set parallel_tuple_cost = 0')
|
518 | 527 |
|
|