postgres.git / summary / log / commit / refs
commit cc4e99546ede50f1074e9c9459361b3166ca4d0a
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: Fri Sep 07 22:13:29 2018 +0000
First released in: 12.0, 9.3.25, 9.4.20, 9.5.15, 9.6.11, 10.6, 11.0
Limit depth of forced recursion for CLOBBER_CACHE_RECURSIVELY.
It's somewhat surprising that we got away with this before. (Actually,
since nobody tests this routinely AFAIK, it might've been broken for
awhile. But it's definitely broken in the wake of commit f868a8143.)
It seems sufficient to limit the forced recursion to a small number
of levels.
Back-patch to all supported branches, like the preceding patch.
Discussion: https://postgr.es/m/12259.1532117714@sss.pgh.pa.us
src/backend/utils/cache/inval.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/src/backend/utils/cache/inval.c b/src/backend/utils/cache/inval.c
index c4888a8a765..b2729cd7d91 100644
--- a/src/backend/utils/cache/inval.c
+++ b/src/backend/utils/cache/inval.c
@@ -699,7 +699,17 @@ AcceptInvalidationMessages(void)
}
}
#elif defined(CLOBBER_CACHE_RECURSIVELY)
- InvalidateSystemCaches();
+ {
+ static int recursion_depth = 0;
+
+ /* Maximum depth is arbitrary depending on your threshold of pain */
+ if (recursion_depth < 3)
+ {
+ recursion_depth++;
+ InvalidateSystemCaches();
+ recursion_depth--;
+ }
+ }
#endif
}
[parent: 66321ae61baf]