aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2018-09-07 18:13:29 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2018-09-07 18:14:15 -0400
commitadfc156d356a6bd80293464b6a33b93c0184a92f (patch)
tree69d6a806e824e7e481fa3b5b75b49fc1e85dc973 /src
parent9e6f4fbdd0cfcf7235f884d662aed4f2a1c416c3 (diff)
downloadpostgresql-adfc156d356a6bd80293464b6a33b93c0184a92f.tar.gz
postgresql-adfc156d356a6bd80293464b6a33b93c0184a92f.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/backend/utils/cache/inval.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/backend/utils/cache/inval.c b/src/backend/utils/cache/inval.c
index 2226b325720..a7e9762fd19 100644
--- a/src/backend/utils/cache/inval.c
+++ b/src/backend/utils/cache/inval.c
@@ -708,7 +708,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
}