Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 03becee

Browse files
committed
Merge branch 'master' into rel_future_beta
2 parents 5faa32a + 9a70505 commit 03becee

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

expected/pathman_bgw.out

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ DECLARE
187187
i int4 := 0; -- protect from endless loop
188188
BEGIN
189189
LOOP
190+
-- get total number of processed rows
190191
SELECT processed
191192
FROM pathman_concurrent_part_tasks
192193
WHERE relid = 'test_bgw.conc_part'::regclass
@@ -200,9 +201,12 @@ BEGIN
200201

201202
ASSERT rows IS NOT NULL;
202203

203-
-- rows should increase!
204-
IF rows_old <= rows THEN
204+
IF rows_old = rows THEN
205205
i = i + 1;
206+
ELSIF rows < rows_old THEN
207+
RAISE EXCEPTION 'rows is decreasing: new %, old %', rows, rows_old;
208+
ELSIF rows > 500 THEN
209+
RAISE EXCEPTION 'processed % rows', rows;
206210
END IF;
207211
ELSE
208212
EXIT; -- exit loop

sql/pathman_bgw.sql

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ DECLARE
101101
i int4 := 0; -- protect from endless loop
102102
BEGIN
103103
LOOP
104+
-- get total number of processed rows
104105
SELECT processed
105106
FROM pathman_concurrent_part_tasks
106107
WHERE relid = 'test_bgw.conc_part'::regclass
@@ -114,9 +115,12 @@ BEGIN
114115

115116
ASSERT rows IS NOT NULL;
116117

117-
-- rows should increase!
118-
IF rows_old <= rows THEN
118+
IF rows_old = rows THEN
119119
i = i + 1;
120+
ELSIF rows < rows_old THEN
121+
RAISE EXCEPTION 'rows is decreasing: new %, old %', rows, rows_old;
122+
ELSIF rows > 500 THEN
123+
RAISE EXCEPTION 'processed % rows', rows;
120124
END IF;
121125
ELSE
122126
EXIT; -- exit loop

src/pathman_workers.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ partition_table_concurrently(PG_FUNCTION_ARGS)
763763

764764
/* Looks like we could not find an empty slot */
765765
if (empty_slot_idx < 0)
766-
ereport(ERROR, (ERRCODE_CONFIGURATION_LIMIT_EXCEEDED,
766+
ereport(ERROR, (errcode(ERRCODE_CONFIGURATION_LIMIT_EXCEEDED),
767767
errmsg("no empty worker slots found"),
768768
errhint("consider increasing max_worker_processes")));
769769
else

0 commit comments

Comments
 (0)