Skip to content

Commit c59990e

Browse files
committed
Merged new ptrack, probackup and pathman
2 parents 8581033 + 2f7af48 commit c59990e

File tree

98 files changed

+5589
-2052
lines changed

Some content is hidden

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

98 files changed

+5589
-2052
lines changed

configure

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2770,7 +2770,7 @@ else
27702770
fi
27712771

27722772

2773-
PGPRO_VERSION="$PACKAGE_VERSION.1"
2773+
PGPRO_VERSION="$PACKAGE_VERSION.2"
27742774
PGPRO_PACKAGE_NAME="PostgresPro"
27752775
PGPRO_EDITION="enterprise"
27762776

@@ -16078,24 +16078,6 @@ cat >>confdefs.h <<_ACEOF
1607816078
_ACEOF
1607916079

1608016080

16081-
16082-
if test x"$HAVE_LONG_LONG_INT_64" = xyes ; then
16083-
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16084-
/* end confdefs.h. */
16085-
16086-
#define INT64CONST(x) x##LL
16087-
long long int foo = INT64CONST(0x1234567890123456);
16088-
16089-
_ACEOF
16090-
if ac_fn_c_try_compile "$LINENO"; then :
16091-
16092-
$as_echo "#define HAVE_LL_CONSTANTS 1" >>confdefs.h
16093-
16094-
fi
16095-
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16096-
fi
16097-
16098-
1609916081
# If we found "long int" is 64 bits, assume snprintf handles it. If
1610016082
# we found we need to use "long long int", better check. We cope with
1610116083
# snprintfs that use %lld, %qd, or %I64d as the format. If none of these

configure.in

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ AC_DEFINE_UNQUOTED(PG_MAJORVERSION, "$PG_MAJORVERSION", [PostgreSQL major versio
3838
PGAC_ARG_REQ(with, extra-version, [STRING], [append STRING to version],
3939
[PG_VERSION="$PACKAGE_VERSION$withval"],
4040
[PG_VERSION="$PACKAGE_VERSION"])
41-
PGPRO_VERSION="$PACKAGE_VERSION.1"
41+
PGPRO_VERSION="$PACKAGE_VERSION.2"
4242
PGPRO_PACKAGE_NAME="PostgresPro"
4343
PGPRO_EDITION="enterprise"
4444
AC_SUBST(PGPRO_PACKAGE_NAME)
@@ -1877,18 +1877,6 @@ fi
18771877
AC_DEFINE_UNQUOTED(PG_INT64_TYPE, $pg_int64_type,
18781878
[Define to the name of a signed 64-bit integer type.])
18791879

1880-
dnl If we need to use "long long int", figure out whether nnnLL notation works.
1881-
1882-
if test x"$HAVE_LONG_LONG_INT_64" = xyes ; then
1883-
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
1884-
#define INT64CONST(x) x##LL
1885-
long long int foo = INT64CONST(0x1234567890123456);
1886-
])],
1887-
[AC_DEFINE(HAVE_LL_CONSTANTS, 1, [Define to 1 if constants of type 'long long int' should have the suffix LL.])],
1888-
[])
1889-
fi
1890-
1891-
18921880
# If we found "long int" is 64 bits, assume snprintf handles it. If
18931881
# we found we need to use "long long int", better check. We cope with
18941882
# snprintfs that use %lld, %qd, or %I64d as the format. If none of these

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.3",
5+
"version": "1.4.6",
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.3",
27+
"version": "1.4.6",
2828
"abstract": "Partitioning tool"
2929
}
3030
},

contrib/pg_pathman/Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ OBJS = src/init.o src/relation_info.o src/utils.o src/partition_filter.o \
1010
src/compat/pg_compat.o src/compat/relation_tags.o src/compat/rowmarks_fix.o \
1111
$(WIN32RES)
1212

13+
ifdef USE_PGXS
14+
override PG_CPPFLAGS += -I$(CURDIR)/src/include
15+
else
1316
override PG_CPPFLAGS += -I$(top_srcdir)/$(subdir)/src/include
17+
endif
1418

1519
EXTENSION = pg_pathman
1620

@@ -35,6 +39,7 @@ REGRESS = pathman_array_qual \
3539
pathman_domains \
3640
pathman_expressions \
3741
pathman_foreign_keys \
42+
pathman_gaps \
3843
pathman_inserts \
3944
pathman_interval \
4045
pathman_join_clause \
@@ -48,7 +53,8 @@ REGRESS = pathman_array_qual \
4853
pathman_runtime_nodes \
4954
pathman_update_trigger \
5055
pathman_upd_del \
51-
pathman_utility_stmt
56+
pathman_utility_stmt \
57+
pathman_views
5258

5359
EXTRA_REGRESS_OPTS=--temp-config=$(top_srcdir)/$(subdir)/conf.add
5460

contrib/pg_pathman/expected/pathman_bgw.out

Lines changed: 76 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ SELECT set_init_callback('test_bgw.test_5', 'test_bgw.abort_xact(jsonb)');
132132
(1 row)
133133

134134
INSERT INTO test_bgw.test_5 VALUES (-100);
135-
ERROR: Attempt to spawn new partitions of relation "test_5" failed
135+
ERROR: attempt to spawn new partitions of relation "test_5" failed
136136
SELECT * FROM pathman_partition_list ORDER BY partition; /* should contain 3 partitions */
137137
parent | partition | parttype | expr | range_min | range_max
138138
-----------------+-------------------+----------+------+-----------+-----------
@@ -143,5 +143,80 @@ SELECT * FROM pathman_partition_list ORDER BY partition; /* should contain 3 par
143143
DROP FUNCTION test_bgw.abort_xact(args JSONB);
144144
DROP TABLE test_bgw.test_5 CASCADE;
145145
NOTICE: drop cascades to 3 other objects
146+
/*
147+
* Tests for ConcurrentPartWorker
148+
*/
149+
CREATE TABLE test_bgw.conc_part(id INT4 NOT NULL);
150+
INSERT INTO test_bgw.conc_part SELECT generate_series(1, 500);
151+
SELECT create_hash_partitions('test_bgw.conc_part', 'id', 5, false);
152+
create_hash_partitions
153+
------------------------
154+
5
155+
(1 row)
156+
157+
BEGIN;
158+
/* Also test FOR SHARE/UPDATE conflicts in BGW */
159+
SELECT * FROM test_bgw.conc_part ORDER BY id LIMIT 1 FOR SHARE;
160+
id
161+
----
162+
1
163+
(1 row)
164+
165+
/* Run partitioning bgworker */
166+
SELECT partition_table_concurrently('test_bgw.conc_part', 10, 1);
167+
NOTICE: worker started, you can stop it with the following command: select public.stop_concurrent_part_task('conc_part');
168+
partition_table_concurrently
169+
------------------------------
170+
171+
(1 row)
172+
173+
/* Wait until bgworker starts */
174+
SELECT pg_sleep(1);
175+
pg_sleep
176+
----------
177+
178+
(1 row)
179+
180+
ROLLBACK;
181+
/* Wait until it finises */
182+
DO $$
183+
DECLARE
184+
ops int8;
185+
BEGIN
186+
LOOP
187+
SELECT count(*)
188+
FROM pathman_concurrent_part_tasks
189+
WHERE processed < 500 -- protect from endless loops
190+
INTO ops;
191+
192+
IF ops > 0 THEN
193+
PERFORM pg_sleep(0.2);
194+
ELSE
195+
EXIT;
196+
END IF;
197+
END LOOP;
198+
END
199+
$$ LANGUAGE plpgsql;
200+
/* Check amount of tasks and rows in parent and partitions */
201+
SELECT count(*) FROM pathman_concurrent_part_tasks;
202+
count
203+
-------
204+
0
205+
(1 row)
206+
207+
SELECT count(*) FROM ONLY test_bgw.conc_part;
208+
count
209+
-------
210+
0
211+
(1 row)
212+
213+
SELECT count(*) FROM test_bgw.conc_part;
214+
count
215+
-------
216+
500
217+
(1 row)
218+
219+
DROP TABLE test_bgw.conc_part CASCADE;
220+
NOTICE: drop cascades to 5 other objects
146221
DROP SCHEMA test_bgw CASCADE;
147222
DROP EXTENSION pg_pathman;

contrib/pg_pathman/expected/pathman_calamity.out

Lines changed: 20 additions & 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-
10403
15+
10406
1616
(1 row)
1717

1818
set client_min_messages = NOTICE;
@@ -855,6 +855,25 @@ NOTICE: drop cascades to 2 other objects
855855
DROP SCHEMA calamity CASCADE;
856856
NOTICE: drop cascades to 15 other objects
857857
DROP EXTENSION pg_pathman;
858+
/*
859+
* -------------------------------
860+
* Special tests (SET statement)
861+
* -------------------------------
862+
*/
863+
CREATE EXTENSION pg_pathman;
864+
SET pg_pathman.enable = false;
865+
NOTICE: RuntimeAppend, RuntimeMergeAppend and PartitionFilter nodes and some other options have been disabled
866+
SET pg_pathman.enable = true;
867+
NOTICE: RuntimeAppend, RuntimeMergeAppend and PartitionFilter nodes and some other options have been enabled
868+
SET pg_pathman.enable = false;
869+
NOTICE: RuntimeAppend, RuntimeMergeAppend and PartitionFilter nodes and some other options have been disabled
870+
RESET pg_pathman.enable;
871+
NOTICE: RuntimeAppend, RuntimeMergeAppend and PartitionFilter nodes and some other options have been enabled
872+
RESET ALL;
873+
BEGIN; ROLLBACK;
874+
BEGIN ISOLATION LEVEL SERIALIZABLE; ROLLBACK;
875+
BEGIN; SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; ROLLBACK;
876+
DROP EXTENSION pg_pathman;
858877
/*
859878
* -------------------------------------
860879
* Special tests (pathman_cache_stats)

0 commit comments

Comments
 (0)