PCP_PROMOTE_NODE(1)
π PCP_PROMOTE_NODE(1) β the glow-up guide π
okay bestie, welcome to the pgpool-II 4.7.2 docs, page one and only: pcp_promote_node. she's giving main character energy and she's here to hand out promotions π
β¨ NAME β¨
pcp_promote_node β promotes the given node as new main to Pgpool-II π«Ά
πΈ SYNOPSIS πΈ
pcp_promote_node [options...] [node_id] [gracefully] [switchover]
π¦ DESCRIPTION π¦
so like, pcp_promote_node promotes the given node as new primary to Pgpool-II. streaming replication mode only, no exceptions bestie. and here's the tea: this command does not actually promote the standby PostgreSQL backend unless the switchover option is specified. it just changes the internal status of Pgpool-II and triggers a failover, and you (yes, you) have to promote standby PostgreSQL outside of Pgpool-II. ik ik, rude. π
If switchover is specified, Pgpool-II detaches the current primary (changes the internal status to down) and executes the failover_command, with the new main node argument set to the specified node id. Because most failover scripts promote the new main node, the specified node will be the new primary node. and the follow_primary_command is necessary to be set properly to turn the former primary into a standby. no cutting corners on that one. π
pcp_promote_node executes the following if switchover is not specified. pleaseeee be warned that if follow_primary_command is set, the command will be executed. it is standard advice that you disable follow_primary_command before executing this command. like, genuinely, do that. π
- Change the status of standby PostgreSQL from standby to primary. It just changes the internal status of Pgpool-II and it does not actually promote the PostgreSQL standby server. (so it's giving promotion, but it's not actually a promotion, iykyk)
- Change the status of the PostgreSQL node which is not specified by this command's argument to
down. It just changes the internal status of Pgpool-II and it does not actually make the PostgreSQL standby server down. - If
follow_primary_commandis set, executefollow_primary_commandagainst PostgreSQL.
pcp_promote_node executes the following if switchover is specified. If follow_primary_command is set, the command will be executed. You need to set follow_primary_command before executing this command because the failover script will create the new primary and other nodes need to be turned into standbys. periodt. π
- Change the status of primary PostgreSQL from
uptodown. This triggersfailover_commandexecution, with the new main node argument set to the specified node id. Because most failover scripts promote the new main node, the specified node will become the new primary node. slay. β - Change the status of the standby PostgreSQL node which is not specified by this command's argument to
down. It just changes the internal status of Pgpool-II and it does not actually make the PostgreSQL standby server down. - If
follow_primary_commandis set, executefollow_primary_commandagainst PostgreSQL.
π OPTIONS π
-nnode_id,--node-id=node_idβ the index of the backend node to promote as new main. the specified node must be in"up"or"waiting"status. no dusty nodes allowed bestie, she has to be ready. π₯-g,--gracefullyβ wait until all clients are disconnected (unlessclient_idle_limit_in_recoveryis-1orrecovery_timeoutis expired). so patient of her honestly π§-s,--switchoverβ let the specified node be actually promoted by triggering thefailover_command. Also changes the current primary node status todown. this is the one that ACTUALLY does the thing π- Other options β See
pcp_common_options(1). go read that one too, she's cute π
β οΈ reminder bestie: without-s/--switchover, nothing on the PostgreSQL side actually happens β it's all Pgpool-II internal status changes. don't get caught lacking. π
okay that's the whole page, you ate it, no cap. this was pgpool-II 4.7.2 documentation, dropped in 2023, and it's literally iconic. go promote a node responsibly π«Άβ¨π
π¦ where this page comes from
- ubuntu stonking: pgpool2 4.7.2-1build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms