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

Commitb67cc6f

Browse files
committed
don't use snapshots in pathman_relcache_hook()
1 parentdc26b4b commitb67cc6f

File tree

2 files changed

+18
-46
lines changed

2 files changed

+18
-46
lines changed

‎src/hooks.c

Lines changed: 14 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -699,8 +699,7 @@ pathman_shmem_startup_hook(void)
699699
void
700700
pathman_relcache_hook(Datumarg,Oidrelid)
701701
{
702-
PartParentSearchsearch;
703-
Oidpartitioned_table;
702+
Oidparent_relid;
704703

705704
/* Hooks can be disabled */
706705
if (!pathman_hooks_enabled)
@@ -721,50 +720,23 @@ pathman_relcache_hook(Datum arg, Oid relid)
721720
forget_bounds_of_partition(relid);
722721

723722
/* Invalidate PartParentInfo cache if needed */
724-
partitioned_table=forget_parent_of_partition(relid,&search);
723+
parent_relid=forget_parent_of_partition(relid,NULL);
725724

726-
switch (search)
725+
/* It *might have been a partition*, invalidate parent */
726+
if (OidIsValid(parent_relid))
727727
{
728-
/* It is (or was) a valid partition */
729-
casePPS_ENTRY_PART_PARENT:
730-
casePPS_ENTRY_PARENT:
731-
{
732-
elog(DEBUG2,"Invalidation message for partition %u [%u]",
733-
relid,MyProcPid);
734-
735-
delay_invalidation_parent_rel(partitioned_table);
736-
}
737-
break;
738-
739-
/* Both syscache and pathman's cache say it isn't a partition */
740-
casePPS_ENTRY_NOT_FOUND:
741-
{
742-
Assert(partitioned_table==InvalidOid);
743-
744-
/* Which means that 'relid' might be parent */
745-
if (relid!=InvalidOid)
746-
delay_invalidation_vague_rel(relid);
747-
#ifdefNOT_USED
748-
elog(DEBUG2,"Invalidation message for relation %u [%u]",
749-
relid,MyProcPid);
750-
#endif
751-
}
752-
break;
728+
delay_invalidation_parent_rel(parent_relid);
753729

754-
/* We can't say anything (state is not transactional) */
755-
casePPS_NOT_SURE:
756-
{
757-
elog(DEBUG2,"Invalidation message for vague relation %u [%u]",
758-
relid,MyProcPid);
759-
760-
delay_invalidation_vague_rel(relid);
761-
}
762-
break;
730+
elog(DEBUG2,"Invalidation message for partition %u [%u]",
731+
relid,MyProcPid);
732+
}
733+
/* We can't say, perform full invalidation procedure */
734+
else
735+
{
736+
delay_invalidation_vague_rel(relid);
763737

764-
default:
765-
elog(ERROR,"Not implemented yet (%s)",
766-
CppAsString(pathman_relcache_hook));
767-
break;
738+
elog(DEBUG2,"Invalidation message for vague relation %u [%u]",
739+
relid,MyProcPid);
768740
}
769741
}
770742

‎src/relation_info.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ static booldelayed_shutdown = false; /* pathman was dropped */
9494

9595

9696
staticbooltry_invalidate_parent(Oidrelid,Oid*parents,intparents_count);
97-
staticOidtry_syscache_parent_search(Oidpartition,PartParentSearch*status);
97+
staticOidtry_catalog_parent_search(Oidpartition,PartParentSearch*status);
9898
staticOidget_parent_of_partition_internal(Oidpartition,
9999
PartParentSearch*status,
100100
HASHACTIONaction);
@@ -1089,16 +1089,16 @@ get_parent_of_partition_internal(Oid partition,
10891089
}
10901090
/* Try fetching parent from syscache if 'status' is provided */
10911091
elseif (status)
1092-
parent=try_syscache_parent_search(partition,status);
1092+
parent=try_catalog_parent_search(partition,status);
10931093
else
10941094
parent=InvalidOid;/* we don't have to set status */
10951095

10961096
returnparent;
10971097
}
10981098

1099-
/* Try to find parent of a partition usingsyscache & PATHMAN_CONFIG */
1099+
/* Try to find parent of a partition usingcatalog & PATHMAN_CONFIG */
11001100
staticOid
1101-
try_syscache_parent_search(Oidpartition,PartParentSearch*status)
1101+
try_catalog_parent_search(Oidpartition,PartParentSearch*status)
11021102
{
11031103
if (!IsTransactionState())
11041104
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp