Hi,
On 2022-03-29 14:48:54 +0800, Hao Wu wrote:
> It's a natural requirement to unregister the callback for transaction or
> subtransaction when the callback is invoked, so we don't have to
> unregister the callback somewhere.
You normally shouldn'd need to do this frequently - what's your use case?
UnregisterXactCallback() is O(N), so workloads registering / unregistering a
lot of callbacks would be problematic.
> Luckily, we just need a few lines of code to support this feature,
> by saving the next pointer before calling the callback.
That seems reasonable...
Greetings,
Andres Freund