On Tuesday, June 28, 2022, Bryn Llewellyn <
bryn@yugabyte.com> wrote:
DISCARD PLANS is unsafe in a multi-user concurrent scenario. The doc says explicitly that its scope is just the single session. And it's easy to show the danger by using my testcase manually, step by appropriate step, with two concurrent sessions.
Impractical maybe, but hardly unsafe (well, relative to not doing anything).
I've concluded that the only practical practice for "immutable" is to reserve its use for functions that don't mention even a single user-created artifact.
That seems like too strong a position to take for me. Go ahead and build immutable utility functions. Just don’t be stupid break your promise. But even then, there are ways to fix things in case of bugs.
David J.