CMAP_DELETE(3)

πŸ’– CMAP_DELETE(3) πŸ’–

okay bestie, welcome to the Corosync Cluster Engine Programmer's Manual, section 3, page CMAP_DELETE. yes it's giving very "library function" of her but honestly? she eats. let's get into it ✨


🌸 NAME 🌸

cmap_delete β€” Delete key/value pair from the CMAP service

like. the name literally tells you everything. she deletes. that's the whole vibe. πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <corosync/cmap.h>

cs_error_t cmap_delete(cmap_handle_t handle, const char *key_name);

two little arguments, one tiny include, zero drama. iconic. πŸ’…


πŸ‘‘ DESCRIPTION πŸ‘‘

so the cmap_delete function is used to delete a key from cmap. and no, you can't just delete whatever you want out of thin air β€” the key must have been previously created by the cmap_set(3) function first. you can't delete something that never existed, that's not how any of this works, bestie 😭

  • handle β€” your connection to the CMAP database, which you got by calling cmap_initialize(3). this is basically your little VIP wristband for the cmap party 🫢
  • key_name β€” the name of the key you want to delete. bye girl, we won't miss you πŸ’€

🌈 RETURN VALUE 🌈

this call returns the CS_OK value if it's successful. slay. but like everything in life, it can go wrong, so here's the tea:

  • if key_name is unspecified, you get CS_ERR_INVALID_PARAM back. you have to actually name the key. you cannot just vibe at the void and expect results πŸ’…
  • for nonexisting keys, you get the CS_ERR_NOT_EXIST error. so sad, so tragic, that key was never real to begin with πŸ™ˆ
  • and listen β€” some of the keys may be tagged read-only directly in corosync, and deleting such a key will result in a CS_ERR_ACCESS error. periodt. you do not have the range, she is protected, leave her alone πŸ”₯

and here's the full roster of error codes that can come back at you, because we keep receipts:

  • 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
lowkey if you get CS_ERR_LIBRARY or CS_ERR_MESSAGE_ERROR something is deeply not okay in the group chat, just saying 🧚

⭐ SEE ALSO ⭐

go read her friends too, they're all linked together, iykyk:


and that's the whole page, no cap. mwah πŸ’– stay hydrated, close your handles, and remember: keys you set, you can delete. keys corosync tagged read-only? absolutely not, she's main character energy and you're not touching her. byeee πŸ¦‹

this has been the corosync Man Page, dated 03/02/2012, signing off like the little legend she is πŸ’œ

πŸ“¦ where this page comes from