CPG_Z...OINED(3)

🌸 CPG_Z...OINED(3) 🌸

okay bestie, welcome to the Corosync Cluster Engine Programmer's Manual πŸ’– this page is literally called CPG_Z...OINED(3) and it's giving "zero copy multicast, but make it a whole vibe." sit down, grab a boba, we're doing this πŸ§‹βœ¨


✨ NAME ✨

cpg_mcast_joined β€” multicasts a zero copy buffer to all groups joined to a handle πŸ¦‹

(no cap, that's the whole name section. short and iconic. periodt.)


🌈 SYNOPSIS 🌈

#include <sys/uio.h> #include <corosync/cpg.h>

int cpg_zcb_mcast_joined(cpg_handle_t handle, cpg_guarantee_t guarantee,
const void *buffer,int msg_len );

like. look at her. the signature. the little msg_len with no space before it. she's chaotic but she's ours πŸ’…


πŸŽ€ DESCRIPTION πŸŽ€

so cpg_zcb_mcast_joined will multicast a zero copy buffer message to literally every process that has been joined up using cpg_join(3) for the same group name. that's the whole point, bestie. any messages sent to any of the groups joined to the parameter handle get delivered to all subscribed processes in the system. every single one. no stragglers. πŸ”₯

the guarantee argument is you requesting a delivery guarantee for the message you're sending. iconic of you. the cpg_guarantee_t type is defined by:

typedef enum {
        CPG_TYPE_UNORDERED,     /* not implemented */
        CPG_TYPE_FIFO,          /* same as agreed */
        CPG_TYPE_AGREED,        /* implemented */
        CPG_TYPE_SAFE           /* not implemented */
} cpg_guarantee_t;

and the meanings of the cpg_guarantee_t typedef are, bestie, listen up:

  • CPG_TYPE_UNORDERED β€” messages are guaranteed to be delivered, but with no particular order. it's giving "we'll get there when we get there." this mode is unimplemented in the CPG library, so don't come crying to me. 😭
  • CPG_TYPE_FIFO β€” messages are guaranteed to be delivered in first sent first delivery order. in fact, this guarantee is equivalent to the CPG_TYPE_AGREED guarantee. they're the same picture, literally. πŸ‘‘
  • CPG_TYPE_AGREED β€” all processors must agree on the order of delivery. if a message is sent from two or more processes at about the same time, the delivery will occur in the same order to all processes. synchronized queens only. πŸ’…
  • CPG_TYPE_SAFE β€” all processes must agree on the order of delivery, and further, all processes must have a copy of the message before any delivery takes place. this mode is unimplemented in the CPG library. so again, not a thing yet. πŸ™ˆ

the msg argument describes the zero copy buffer which is used to transmit a message. this buffer must be allocated by cpg_zcb_alloc(3) β€” do not just vibe-check your way into a random pointer, i'm begging. 🫢

the msg_len argument describes the number of bytes to be transmitted in the zero copy buffer.


πŸ’– RETURN VALUE πŸ’–

this call returns the CS_OK value if successful. otherwise? an error is returned. that's it, that's the tea. ⭐


πŸ’€ ERRORS πŸ’€

the errors are undocumented. yeah. that's the whole section. we know. we're all thinking it. 🧚

πŸ‘‘ SEE ALSO πŸ‘‘

cpg_overview(3), cpg_initialize(3), cpg_finalize(3), cpg_fd_get(3), cpg_dispatch(3), cpg_join(3), cpg_leave(3), cpg_mcast_joined(3), cpg_membership_get(3) cpg_zcb_alloc(3) cpg_zcb_free(3) cpg_zcb_mcast_joined(3) cpg_context_get(3) cpg_context_set(3) cpg_local_get(3)

and then, just chillin' here at the bottom like they were dropped in at the last minute (because they were), the error codes:

  • CS_ERR_TRY_AGAIN β€” Resource temporarily unavailable
  • CS_ERR_INVALID_PARAM β€” Invalid argument
  • CS_ERR_ACCESS β€” Permission denied
  • CS_ERR_LIBRARY β€” The connection failed
  • CS_ERR_INTERRUPT β€” System call interrupted by a signal
  • CS_ERR_NOT_SUPPORTED β€” The requested protocol/functionality not supported
  • CS_ERR_MESSAGE_ERROR β€” Incorrect auth message received
  • CS_ERR_NO_MEMORY β€” Not enough memory to complete the requested task

and that's the page, bestie!! 🫢 this was the corosync Man Page, dated 2004-08-31 β€” yes she's a vintage queen and she ate β€” mwah, stay zero-copy, stay agreed-order, and go allocate that buffer properly πŸ’œβœ¨πŸŽ€

πŸ“¦ where this page comes from