Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7387419

Browse files
committed
Merge branch 'test_concurrent_detach' into rel_1_3_beta
2 parents7813e85 +fa7dab5 commit7387419

File tree

3 files changed

+23
-6
lines changed

3 files changed

+23
-6
lines changed

‎tests/python/partitioning_test.py

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,17 @@ def test_concurrent_detach(self):
721721
inserts_advance=1# abvance in sec of inserts process under detachs
722722
test_interval=int(math.ceil(detach_timeout*num_detachs))
723723

724+
insert_pgbench_script=os.path.dirname(os.path.realpath(__file__)) \
725+
+"/pgbench_scripts/insert_current_timestamp.pgbench"
726+
detach_pgbench_script=os.path.dirname(os.path.realpath(__file__)) \
727+
+"/pgbench_scripts/detachs_in_timeout.pgbench"
728+
729+
# Check pgbench scripts on existance
730+
self.assertTrue(os.path.isfile(insert_pgbench_script),
731+
msg="pgbench script with insert timestamp doesn't exist")
732+
self.assertTrue(os.path.isfile(detach_pgbench_script),
733+
msg="pgbench script with detach letfmost partition doesn't exist")
734+
724735
# Create and start new instance
725736
node=self.start_new_pathman_cluster(allows_streaming=False)
726737

@@ -733,16 +744,21 @@ def test_concurrent_detach(self):
733744

734745
# Run in background inserts and detachs processes
735746
FNULL=open(os.devnull,'w')
747+
748+
# init pgbench's utility tables
749+
init_pgbench=node.pgbench(stdout=FNULL,stderr=FNULL,options=["-i"])
750+
init_pgbench.wait()
751+
736752
inserts=node.pgbench(stdout=FNULL,stderr=subprocess.PIPE,options=[
737753
"-j","%i"%num_insert_workers,
738754
"-c","%i"%num_insert_workers,
739-
"-f","pgbench_scripts/insert_current_timestamp.pgbench",
755+
"-f",insert_pgbench_script,
740756
"-T","%i"% (test_interval+inserts_advance)
741757
])
742758
time.sleep(inserts_advance)
743759
detachs=node.pgbench(stdout=FNULL,stderr=subprocess.PIPE,options=[
744760
"-D","timeout=%f"%detach_timeout,
745-
"-f","pgbench_scripts/detachs_in_timeout.pgbench",
761+
"-f",detach_pgbench_script,
746762
"-T","%i"%test_interval
747763
])
748764

@@ -752,10 +768,8 @@ def test_concurrent_detach(self):
752768

753769
# Obtain error log from inserts process
754770
inserts_errors=inserts.stderr.read()
755-
756-
self.assertIsNone(
757-
re.search("ERROR: constraint",inserts_errors),
758-
msg="Race condition between detach and concurrent inserts with append partition is expired")
771+
self.assertIsNone(re.search("ERROR|FATAL|PANIC",inserts_errors),
772+
msg="Race condition between detach and concurrent inserts with append partition is expired")
759773

760774
# Stop instance and finish work
761775
node.stop()
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
select detach_range_partition(partition) from (select partition from pathman_partition_list where parent='ts_range_partitioned'::regclass order by range_min limit 1) t;
2+
select pg_sleep(:timeout);
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
insert into ts_range_partitioned values (current_timestamp);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp