Chapter 5 (CDB) of the ConfD User Guide says the following:
Note that even though the notifications are delivered within the transaction it is not possible for a subscriber to reject the changes (since this would break the two-phase commit protocol used by the ConfD backplane towards all data-providers).
The problem is that errors might happen when trying to apply a configuration change, especially when trying to allocate resources (e.g. sockets). In these cases the configuration changes must be rejected instead of ignoring the errors silently. Is it possible to do that when using CDB?
It seems to me that, when using the external database API, it’s possible to use the prepare
transaction callback to allocate resources and check for errors. But I believe it’s not possible to register transaction callbacks and subscribe to CDB in the same program.
One other possibility I thought about is to confd_register_valpoint_cb()
to perform error checking, but apparently the purpose of this API is to do semantic validation of the data.
I’m kind of lost here on how to handle resource allocation errors. I’d appreciate if someone could shed some light on what to do.
Regards,
Renato.