-
Notifications
You must be signed in to change notification settings - Fork 337
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: controller: Replace node state atomically at DC join ack step
Currently, do_dc_join_ack() deletes part of the joining node's resource history from the CIB and then updates the remaining portion. If we query the CIB or we're interrupted in some way between the delete and the update, then we get a bad view of the state, where pieces are missing. Here, we use a CIB transaction to ensure that the update happens atomically as a replacement. Of note: anything passed as user_data to a CIB client callback must be freeable by the function passed to cib_client_register_callback_full() as the free_func argument. That argument is of type void (*free_func)(void *). free_xml() can't be passed as the free_func() argument to a CIB client callback. The behavior is undefined by the C standard, and GCC throws an error. (void *) and (xmlNode *) are not compatible. - https://stackoverflow.com/a/559671/7660197 Casting might be safe in practice though: - https://stackoverflow.com/a/14044244/7660197 Closes T186 Closes CLBZ#5306 Closes RHBZ#2000595 Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
- Loading branch information
Showing
1 changed file
with
162 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters