Skip to content

Commit 72cd580

Browse files
committed
Merge branch 'PGPRO9_6' of git.postgrespro.ru:pgpro-dev/postgrespro into PGPRO9_6
2 parents c399e22 + 672f4ae commit 72cd580

File tree

90 files changed

+1881
-786
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+1881
-786
lines changed

configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14746,7 +14746,7 @@ fi
1474614746
LIBS_including_readline="$LIBS"
1474714747
LIBS=`echo "$LIBS" | sed -e 's/-ledit//g' -e 's/-lreadline//g'`
1474814748

14749-
for ac_func in cbrt dlopen fdatasync getifaddrs getpeerucred getrlimit mbstowcs_l memmove poll pstat pthread_is_threaded_np readlink setproctitle setsid shm_open symlink sync_file_range towlower utime utimes wcstombs wcstombs_l
14749+
for ac_func in cbrt dlopen fdatasync getifaddrs getpeerucred getrlimit mbstowcs_l memmove poll posix_fallocate pstat pthread_is_threaded_np readlink setproctitle setsid shm_open symlink sync_file_range towlower utime utimes wcstombs wcstombs_l
1475014750
do :
1475114751
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
1475214752
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"

configure.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1562,7 +1562,7 @@ PGAC_FUNC_WCSTOMBS_L
15621562
LIBS_including_readline="$LIBS"
15631563
LIBS=`echo "$LIBS" | sed -e 's/-ledit//g' -e 's/-lreadline//g'`
15641564

1565-
AC_CHECK_FUNCS([cbrt dlopen fdatasync getifaddrs getpeerucred getrlimit mbstowcs_l memmove poll pstat pthread_is_threaded_np readlink setproctitle setsid shm_open symlink sync_file_range towlower utime utimes wcstombs wcstombs_l])
1565+
AC_CHECK_FUNCS([cbrt dlopen fdatasync getifaddrs getpeerucred getrlimit mbstowcs_l memmove poll posix_fallocate pstat pthread_is_threaded_np readlink setproctitle setsid shm_open symlink sync_file_range towlower utime utimes wcstombs wcstombs_l])
15661566

15671567
AC_REPLACE_FUNCS(fseeko)
15681568
case $host_os in

contrib/online_analyze/online_analyze.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,9 @@ makeAnalyze(Oid relOid, CmdKind operation, int64 naffected)
557557
&vacstmt, NULL, true, GetAccessStrategy(BAS_VACUUM)
558558
#endif
559559
);
560+
561+
/* Make changes visible to subsequent calls */
562+
CommandCounterIncrement();
560563

561564
if (online_analyze_verbose)
562565
{

contrib/pg_pathman/META.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "pg_pathman",
33
"abstract": "Partitioning tool",
44
"description": "The `pg_pathman` module provides optimized partitioning mechanism and functions to manage partitions.",
5-
"version": "1.4.6",
5+
"version": "1.4.7",
66
"maintainer": [
77
"Ildar Musin <i.musin@postgrespro.ru>",
88
"Dmitry Ivanov <d.ivanov@postgrespro.ru>",
@@ -24,7 +24,7 @@
2424
"pg_pathman": {
2525
"file": "pg_pathman--1.4.sql",
2626
"docfile": "README.md",
27-
"version": "1.4.6",
27+
"version": "1.4.7",
2828
"abstract": "Partitioning tool"
2929
}
3030
},

contrib/pg_pathman/expected/pathman_bgw.out

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,19 +181,39 @@ ROLLBACK;
181181
/* Wait until it finises */
182182
DO $$
183183
DECLARE
184-
ops int8;
184+
ops int8;
185+
rows int8;
186+
rows_old int8 := 0;
187+
i int4 := 0; -- protect from endless loop
185188
BEGIN
186189
LOOP
187-
SELECT count(*)
190+
SELECT processed
188191
FROM pathman_concurrent_part_tasks
189-
WHERE processed < 500 -- protect from endless loops
190-
INTO ops;
192+
WHERE relid = 'test_bgw.conc_part'::regclass
193+
INTO rows;
194+
195+
-- get number of partitioning tasks
196+
GET DIAGNOSTICS ops = ROW_COUNT;
191197

192198
IF ops > 0 THEN
193199
PERFORM pg_sleep(0.2);
200+
201+
ASSERT rows IS NOT NULL;
202+
203+
-- rows should increase!
204+
IF rows_old <= rows THEN
205+
i = i + 1;
206+
END IF;
194207
ELSE
195-
EXIT;
208+
EXIT; -- exit loop
196209
END IF;
210+
211+
IF i > 50 THEN
212+
RAISE WARNING 'looks like partitioning bgw is stuck!';
213+
EXIT; -- exit loop
214+
END IF;
215+
216+
rows_old = rows;
197217
END LOOP;
198218
END
199219
$$ LANGUAGE plpgsql;

contrib/pg_pathman/expected/pathman_calamity.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ SELECT debug_capture();
1212
SELECT get_pathman_lib_version();
1313
get_pathman_lib_version
1414
-------------------------
15-
10406
15+
10407
1616
(1 row)
1717

1818
set client_min_messages = NOTICE;

contrib/pg_pathman/sql/pathman_bgw.sql

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,19 +95,39 @@ ROLLBACK;
9595
/* Wait until it finises */
9696
DO $$
9797
DECLARE
98-
ops int8;
98+
ops int8;
99+
rows int8;
100+
rows_old int8 := 0;
101+
i int4 := 0; -- protect from endless loop
99102
BEGIN
100103
LOOP
101-
SELECT count(*)
104+
SELECT processed
102105
FROM pathman_concurrent_part_tasks
103-
WHERE processed < 500 -- protect from endless loops
104-
INTO ops;
106+
WHERE relid = 'test_bgw.conc_part'::regclass
107+
INTO rows;
108+
109+
-- get number of partitioning tasks
110+
GET DIAGNOSTICS ops = ROW_COUNT;
105111

106112
IF ops > 0 THEN
107113
PERFORM pg_sleep(0.2);
114+
115+
ASSERT rows IS NOT NULL;
116+
117+
-- rows should increase!
118+
IF rows_old <= rows THEN
119+
i = i + 1;
120+
END IF;
108121
ELSE
109-
EXIT;
122+
EXIT; -- exit loop
110123
END IF;
124+
125+
IF i > 50 THEN
126+
RAISE WARNING 'looks like partitioning bgw is stuck!';
127+
EXIT; -- exit loop
128+
END IF;
129+
130+
rows_old = rows;
111131
END LOOP;
112132
END
113133
$$ LANGUAGE plpgsql;

contrib/pg_pathman/src/include/init.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ simpify_mcxt_name(MemoryContext mcxt)
157157
#define LOWEST_COMPATIBLE_FRONT 0x010400
158158

159159
/* Current version of native C library (0xAA_BB_CC) */
160-
#define CURRENT_LIB_VERSION 0x010406
160+
#define CURRENT_LIB_VERSION 0x010407
161161

162162

163163
void *pathman_cache_search_relid(HTAB *cache_table,

contrib/pg_pathman/src/include/pathman_workers.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ typedef struct
7474
pid_t pid; /* worker's PID */
7575
Oid dbid; /* database which contains the relation */
7676
Oid relid; /* table to be partitioned concurrently */
77-
uint64 total_rows; /* total amount of rows processed */
77+
int64 total_rows; /* total amount of rows processed */
7878

7979
int32 batch_size; /* number of rows in a batch */
8080
float8 sleep_time; /* how long should we sleep in case of error? */

0 commit comments

Comments
 (0)