ConfD User Community

Confd - delete and create in single commit


I am trying to delete and create the same record with different values in a single commit transaction in confd.
Few questions:

  1. is there any confd commit order which guarantees the final result as final record with updated values?
  2. How the call back ordering is defined by default - delete first and create call back or can it be out of sequence?

I have a validation call back handler which gets called.
The validation handler checks for a particular value and if its already configured then it wont allow to change it.

When I do this on cli or even through single editConfig through netconf the result is same and the validation callback for create is failing because it checks for configured value for a particular attribute and doesnt allow to change it.

In this particular delete/create case, is there any order of validation handler callbacks?
If its not and validation for both commands can be called in any order then how to avoid this validation check before commit to identify that the value is configured already but validation is part of transaction where the previous record is getting deleted and this will be new record so ignore the configured value in this case.

Not sure if there is any way to achieve this.


A transaction consists of the committed changes vs the old config, not the operations such as create or delete.

Also, first rule of validation, validate the resulting configuration, not operations. From the ConfD UG Chapter Validation Logic:

Attempting to validate the operations instead of the resulting configuration can lead to problems with loading config backups or doing rollbacks. The old configuration that should be applied as a result of such actions is obviously valid (as long as the logical constraints have not changed), but validation logic that rejects specific changes to the configuration may still result in that configuration being rejected.


Thanks @cohult for you response.

Its still not clear to me but I think what you are saying is that the validation call back is called on resulting configuration.

For Delete/create in single commit, does this mean confd figures out internally that the resulting config is just edit on existing config and calls validation handler with the new config?

In this case, if validation doesnt allow edit of some attrbiutes then the only way to achieve this is to have 2 seperate transaction? one for delete and one for create?