]> git.proxmox.com Git - mirror_frr.git/commit
lib: fix NETCONF network-wide transactions for confd and sysrepo
authorRenato Westphal <renato@opensourcerouting.org>
Fri, 7 Dec 2018 17:27:34 +0000 (15:27 -0200)
committerRenato Westphal <renato@opensourcerouting.org>
Fri, 7 Dec 2018 18:01:34 +0000 (16:01 -0200)
commit88a7d121d1cd8d65db0179be019508bcbcdd266e
tree34ee68c1f61d4567571b35e64eb8079ceaa75d8d
parentac92680d8ddba0ab3ddf3099b22b75cc81e50ffa
lib: fix NETCONF network-wide transactions for confd and sysrepo

ConfD and Sysrepo implement configuration transactions using a
two-phase commit protocol (prepare + abort/apply). For network-wide
transactions to work, ConfD and Sysrepo move to the second phase of
the commit protocol only after receiving the results of the first
phase from all devices involved in the transaction. If all devices
succeed in the 'prepare' phase, then all of them move to the 'apply'
phase and the transaction is committed. On the other hand, if any
device fails in the 'prepare' phase, all of them move to 'abort'
phase and the transaction is aborted.

The confd and sysrepo plugins were implementing the full
two-phase commit protocol upon receiving a request to validate
the configuration changes and allocate all resources required to
apply them (first phase). The notifications to abort or apply the
changes (second phase) were being ignored since everything was being
done in the first phase for simplicity. This wasn't a problem for
single-device transactions, but it is for transactions involving
multiple devices.  Rework the code a bit to do things properly and
fix this problem.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
lib/northbound_confd.c
lib/northbound_sysrepo.c