Application behavior when confd_load is used to repace the config

Hello,

confd_load tool has two options to load and xml.

  1. When used with -m argument, it merges the existing configuration with the incoming one.
  2. Without -m, it replaces the original configuration, with the new one.

When second option(without -m, that is replace) is used, how does the delete notification to subscribers work?
Will confd sends delete for all original configurations and create for the new configuration
OR
Delete only for the configurations that are not present in new configuration? With some smart diff approach.

For example in current configuration I have
ip_interface_01
ip_interface_02
ip_interface_03
ip_interface_04

And in new configuration

ip_interface_01
ip_interface_02
ip_interface_03
ip_interface_05

and I load the new config with confd_load -l new.xml,

will I get
4 deletes and 4 create?
OR
1 delete and 1 create?

Thanks, Prasanth

Hi,
A good way to find out what the confd_load and confd_cmd tools are doing is to add “-d -d” debug level.
Example:

$ confd_load -d -d -l -m test.xml 
TRACE Connected (maapi) to ConfD
starting user session ctxt=system user=system groups=[system]
TRACE MAAPI_START_USER_SESSION  --> CONFD_OK
TRACE MAAPI_START_TRANS  --> CONFD_OK
TRACE MAAPI_LOAD_CONFIG_FILE  --> CONFD_OK
TRACE MAAPI_APPLY_TRANS  --> CONFD_OK
TRACE MAAPI_END_USER_SESSION  --> CONFD_OK

So now you can see that the confd_load tool use maapi_load_config() to set the configuration. See confd_lib_maapi(3) man page for details on maapi_load_config().

As for deleting and creating configuration in the same transaction, you will always get the resulting diff only in your subscriber / callpoint handler