mirror of
https://git.proxmox.com/git/mirror_corosync
synced 2025-08-15 15:23:48 +00:00

Current quorum callback contains only actual view list and there is no way how to find out joined/left nodes. This cannot be emulated by user app, because when corosync restarts before other nodes notices then view list is unchanged (ring id is changed tho). Solution is to implement similar callback as for cpg which contains ring id, member list, joined list and left list. To implement such callback and keep backwards compatibility, quorum_model_initialize is introduced. Its behavior is similar to cpg_model_initialize. This allows passing model v1, which contains enhanced quorum (full ring id is passed instead of just seq number) and nodelist callbacks. To find out which events should be sent by corosync daemon, new message MESSAGE_REQ_QUORUM_MODEL_GETTYPE is used. Quorum library on init was sending MESSAGE_REQ_QUORUM_GETTYPE. Whem model v1 is requested the MESSAGE_REQ_QUORUM_MODEL_GETTYPE is used, which contains model number so corosync knows that client is using model v1 and can send enhanced quorum and nodelist events. Nodelist event is (for now) send both in case of change of membership and also when requested, also when CS_TRACK_CURRENT is requested, but then left_list and joined_list is left empty, because they don't make too much sense there. New test application testquorummodel is added as an example of new API usage. Also during patch developement, I found few bugs here and there, which are also fixed: - quorum_initialize was never returning error code returned by MESSAGE_REQ_QUORUM_GETTYPE call (always returned CS_OK) - Allocated memory in send_library_notification was based on sizeof(unsigned int) instead of mar_uint32_t. That's not wrong, but it make more sense to use sizeof(mar_uint32_t) instead (big thanks to Chrissie for englishify the man pages) Signed-off-by: Jan Friesse <jfriesse@redhat.com> Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
2 lines
6 B
Plaintext
2 lines
6 B
Plaintext
5.1.0
|