@@ -991,7 +991,6 @@ finish_delayed_invalidation(void)
991
991
{
992
992
Oid * parents = NULL ;
993
993
int parents_count = 0 ;
994
- bool parents_fetched = false;
995
994
ListCell * lc ;
996
995
997
996
AcceptInvalidationMessages ();
@@ -1017,26 +1016,19 @@ finish_delayed_invalidation(void)
1017
1016
1018
1017
/* Disregard all remaining invalidation jobs */
1019
1018
delayed_invalidation_whole_cache = false;
1020
- free_invalidation_lists ();
1021
1019
1022
- /* No need to continue, exit */
1023
- return ;
1020
+ goto end ;
1024
1021
}
1025
1022
}
1026
1023
1024
+ parents = read_parent_oids (& parents_count );
1025
+
1027
1026
/* We might be asked to perform a complete cache invalidation */
1028
1027
if (delayed_invalidation_whole_cache )
1029
1028
{
1030
1029
/* Unset 'invalidation_whole_cache' flag */
1031
1030
delayed_invalidation_whole_cache = false;
1032
1031
1033
- /* Fetch all partitioned tables */
1034
- if (!parents_fetched )
1035
- {
1036
- parents = read_parent_oids (& parents_count );
1037
- parents_fetched = true;
1038
- }
1039
-
1040
1032
/* Invalidate live entries and remove dead ones */
1041
1033
invalidate_pathman_relation_info_cache (parents , parents_count );
1042
1034
}
@@ -1050,13 +1042,6 @@ finish_delayed_invalidation(void)
1050
1042
if (IsToastNamespace (get_rel_namespace (parent )))
1051
1043
continue ;
1052
1044
1053
- /* Fetch all partitioned tables */
1054
- if (!parents_fetched )
1055
- {
1056
- parents = read_parent_oids (& parents_count );
1057
- parents_fetched = true;
1058
- }
1059
-
1060
1045
/* Check if parent still exists */
1061
1046
if (bsearch_oid (parent , parents , parents_count ))
1062
1047
/* get_pathman_relation_info() will refresh this entry */
@@ -1074,13 +1059,6 @@ finish_delayed_invalidation(void)
1074
1059
if (IsToastNamespace (get_rel_namespace (vague_rel )))
1075
1060
continue ;
1076
1061
1077
- /* Fetch all partitioned tables */
1078
- if (!parents_fetched )
1079
- {
1080
- parents = read_parent_oids (& parents_count );
1081
- parents_fetched = true;
1082
- }
1083
-
1084
1062
/* It might be a partitioned table or a partition */
1085
1063
if (!try_invalidate_parent (vague_rel , parents , parents_count ))
1086
1064
{
@@ -1117,6 +1095,7 @@ finish_delayed_invalidation(void)
1117
1095
}
1118
1096
}
1119
1097
1098
+ end :
1120
1099
/* Finally, free invalidation jobs lists */
1121
1100
free_invalidation_lists ();
1122
1101
0 commit comments