PCP_DETACH_NODE(1)

πŸ’… PCP_DETACH_NODE β€” yeah it's a pcp_detach_node(1) situation bestie

okay so real talk, this is the pgpool-II 4.7.2 Documentation page for pcp_detach_node, and she is that girl. let's get into it πŸŽ€


✨ NAME ✨

pcp_detach_node β€” detaches the given node from Pgpool-II. Existing connections to Pgpool-II are forced to be disconnected. no cap, the connections are getting βœ‚οΈ'd


🌈 SYNOPSIS 🌈

pcp_detach_node [options...] [node_id] [gracefully]

πŸ’– DESCRIPTION πŸ’–

so pcp_detach_node detaches the given node from Pgpool-II, periodt. and if failover_command and/or follow_primary_command are specified, they get executed too β€” they're coming along for the ride bestie 🫢

also existing connections to Pgpool-II are forced to be disconnected. not asked, not negotiated, just gone πŸ’€

here's the thing though: pcp_detach_node just detaches the node, it does not touch the running backend behind the node. she's a hands-off queen πŸ‘‘. that's literally why this command is iconic β€” when an admin needs to maintain the PostgreSQL node, she can shutdown or stop the backend as many times as she wants. as many. times. πŸ”₯

now, the safest way to re-attach the detached node is:

  1. stop the backend, and
  2. apply pcp_recovery_node(1)

that's the safe route, take it. however β€” and this is a big however β€” if you're sure that there's no replication delay (or the delay will be recovered later on), and the role of the node (primary/standby) will not be changed, then you can use pcp_attach_node(1). like, only then. iykyk πŸ™ˆ


✨ OPTIONS ✨

  • -n node_id
  • --node_id=node_id β€” The index of backend node to detach. that's the ✨lore✨, that's the node you're sending away.
  • -g
  • --gracefully β€” wait until all clients are disconnected (unless client_idle_limit_in_recovery is -1 or recovery_timeout is expired). polite detachment, we love to see it πŸ’…

πŸ’œ Other options πŸ’œ


pgpool-II 4.7.2 Β· 2023 Β· PCP_DETACH_NODE(1) β€” that's the whole page babes, go detach responsibly and slay πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from