]> granicus.if.org Git - postgresql/commitdiff
Increase MAX_SYSCACHE_CALLBACKS to provide more room for extensions.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 11 May 2017 18:51:21 +0000 (14:51 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 11 May 2017 18:51:46 +0000 (14:51 -0400)
Increase from the historical value of 32 to 64.  We are up to 31 callers
of CacheRegisterSyscacheCallback() in HEAD, so if they were all to be
exercised in one process that would leave only one slot for add-on modules.
It's probably not possible for that to happen, but still we clearly need
more daylight here.  (At some point it might be worth making the array
dynamically resizable; but since we've never heard a complaint of "out of
syscache_callback_list slots" happening in the field, I doubt it's worth
it yet.)

Back-patch as far as 9.4, which is where we increased the companion limit
MAX_RELCACHE_CALLBACKS (cf commit f01d1ae3a).  It's not as urgent in
released branches, which have only a couple dozen call sites in core, but
it still seems that somebody might hit the limit before these branches die.

Discussion: https://postgr.es/m/12184.1494450131@sss.pgh.pa.us

src/backend/utils/cache/inval.c

index 0eb7ac783b5b75f374843281857c8aa895a4f408..c75c2d4609dc7d81a337151fb71a9b85c03fcc7a 100644 (file)
@@ -178,7 +178,7 @@ static int  maxSharedInvalidMessagesArray;
  * assumes there won't be very many of these at once; could improve if needed.
  */
 
-#define MAX_SYSCACHE_CALLBACKS 32
+#define MAX_SYSCACHE_CALLBACKS 64
 #define MAX_RELCACHE_CALLBACKS 10
 
 static struct SYSCACHECALLBACK