Skip to content

Commit f510412

Browse files
committed
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 f868a81.) 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
1 parent f868a81 commit f510412

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/backend/utils/cache/inval.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,17 @@ AcceptInvalidationMessages(void)
708708
}
709709
}
710710
#elif defined(CLOBBER_CACHE_RECURSIVELY)
711-
InvalidateSystemCaches();
711+
{
712+
static int recursion_depth = 0;
713+
714+
/* Maximum depth is arbitrary depending on your threshold of pain */
715+
if (recursion_depth < 3)
716+
{
717+
recursion_depth++;
718+
InvalidateSystemCaches();
719+
recursion_depth--;
720+
}
721+
}
712722
#endif
713723
}
714724

0 commit comments

Comments
 (0)