HomeClusterLabs Projects

Refactor: based: Make CIB diff/replace notify more similar

Description

Refactor: based: Make CIB diff/replace notify more similar

We'll soon want to use the call ID and client ID in the controller's
do_cib_replaced() callback function. So we need to add those two fields
to cib_replace_notify()'s message.

While we do that, we might as well align the interfaces of
cib_diff_notify() and cib_replace_notify(), and have them both pass the
same fields where it doesn't add much overhead. This will make it easier
for both kinds of callbacks to use this information in the future if
needed.

Use op instead of PCMK__CIB_REQUEST_REPLACE in cib_replace_notify() just
for future-proofing, since we pass it as an argument now.

We omit the update and diff fields in cib_replace_notify() for now.
Nothing uses them, and including the CIB XML in the message requires
more overhead than a short string field.

We also omit the change_section field from the cib_diff_notify() for
now, since cib_process_command() doesn't set it properly. We can
consider setting it in the future if warranted.

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>

Details

Provenance
nrwahl2Authored on Mar 25 2023, 6:56 PM
Parents
rPf604ff091ef5: Refactor: based: Make attach_cib_generation() static
Branches
Unknown
Tags
Unknown