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

Appearance settings

Commit 16810d9

Browse filesBrowse files
committed
Revisit pathman readiness again.
Most pathman functions break if pathman is disabled: earlier I put defense checks in split and merge range partitions, now it is drop_range_partition_expand_next. Looks like the reason is that pathman caches are not being invalidated if it is disabled: pathman_relcache_hook exits right away then. This is kinda reasonable: if we want to disable pathman completely, why maintain the caches? So this time try to bury the readiness check deeper, in get_pathman_relation_info itself. BTW, pathman caches are not dropped when it is disabled, which looks suspicious on its own -- probably if we re-enable it later, caches might be inconsistent.
1 parent d1032b0 commit 16810d9
Copy full SHA for 16810d9

File tree

3 files changed

+4
-7
lines changed
Filter options

3 files changed

+4
-7
lines changed

‎expected/pathman_calamity.out

Copy file name to clipboardExpand all lines: expected/pathman_calamity.out
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,7 @@ ERROR: pg_pathman is disabled
10091009
SELECT * FROM pathman_partition_list; /* not ok */
10101010
ERROR: pg_pathman is not initialized yet
10111011
SELECT get_part_range('calamity.survivor', 0, NULL::INT); /* not ok */
1012-
ERROR: pg_pathman is not initialized yet
1012+
ERROR: pg_pathman is disabled
10131013
EXPLAIN (COSTS OFF) SELECT * FROM calamity.survivor; /* OK */
10141014
QUERY PLAN
10151015
------------------------------

‎src/pl_range_funcs.c

Copy file name to clipboardExpand all lines: src/pl_range_funcs.c
-6Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -489,9 +489,6 @@ split_range_partition(PG_FUNCTION_ARGS)
489489
char *query;
490490
int i;
491491

492-
if (!IsPathmanReady())
493-
elog(ERROR, "pg_pathman is disabled");
494-
495492
if (!PG_ARGISNULL(0))
496493
{
497494
partition1 = PG_GETARG_OID(0);
@@ -655,9 +652,6 @@ merge_range_partitions(PG_FUNCTION_ARGS)
655652
FmgrInfo finfo;
656653
int i;
657654

658-
if (!IsPathmanReady())
659-
elog(ERROR, "pg_pathman is disabled");
660-
661655
/* Validate array type */
662656
Assert(ARR_ELEMTYPE(arr) == REGCLASSOID);
663657

‎src/relation_info.c

Copy file name to clipboardExpand all lines: src/relation_info.c
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,9 @@ get_pathman_relation_info(Oid relid)
320320
{
321321
PartStatusInfo *psin;
322322

323+
if (!IsPathmanReady())
324+
elog(ERROR, "pg_pathman is disabled");
325+
323326
/* Should always be called in transaction */
324327
Assert(IsTransactionState());
325328

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.