On Sun, 2022-04-03 at 21:33 -0700, Andres Freund wrote: > I still think the easiest and fastest would be to just make RmgrTable > longer, > and not const. When registering, copy the caller provided struct into > the > respective RmgrData element. Yes, we'd waste a bit of space at the > end of the > array, but it's typically not going to be touched and thus not be > backed by > "actual" memory.
Sounds good to me. I tried to break down the performance between these approaches and didn't get a clear signal, so I'll go with your intuition here. Posting new patch in response to Bharath's review, which will include this change. Note that GetRmgr() also has an unlikely branch where it tests for the validity of the rmgr before using it, so that it can throw a nice error message if someone forgot to include the module in shared_preload_libraries. I expect this will be highly predictable and therefore not a problem. Regards, Jeff Davis