HomeClusterLabs Projects

Low: libcib: Allow multiple cib_file clients simultaneously

Description

Low: libcib: Allow multiple cib_file clients simultaneously

Currently, if a process creates two cib_file clients, they will share an
in_mem_cib object, even if they operate on different files. This would
cause obvious conflicts.

This should be a rare use case but there's no reason for an artificial
limitation. It also makes more sense for the client to own its in-memory
copy of the CIB.

More importantly, this fix addresses another upcoming issue. In order to
process CIB transactions correctly in cib_file.c, we'll need a way to
fetch the cib_t object in the commit-transaction processor function.
Each client's transaction data will be stored in its cib_file_opaque_t
object. However, cib_perform_op() does not pass a cib_t object.

This is true even in the common case where only one client is signed on
at a time. The commit-transaction processor needs a way to fetch the
client's cib_t object, so that it can get that client's transaction
request queue.

Ref T185

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

Details

Provenance
nrwahl2Authored on Jun 5 2023, 8:12 PM
Parents
rP958ecfbff6c0: Refactor: libcib: Use cib_operation_t in cib_file.c
Branches
Unknown
Tags
Unknown
Tasks
Restricted Maniphest Task