PostDock icon indicating copy to clipboard operation
PostDock copied to clipboard

Pgpool + Postgres integration

Open paunin opened this issue 7 years ago • 1 comments

Now Pgpool and Repmgr know nothing about each over. But there is a chance when a new master elected pgpool still points to old master.

To Be Done:

  • Pgpool should receive signals from repmgr(event in repmgr?) about new master and automatically exclude old (if it's still online)
  • For short period of time (before helthcheck for false_master is done or it's disabled or no quorum) - splitbrain situation is possible, so pgpool should be ready for that and ignore minor master and it's slaves
  • Pgpool should be able to accept signals about slaves are back (let say after restart)
  • Avoid SSH servers in all containers (pcp protocol?...)

paunin avatar Jul 19 '17 15:07 paunin

Regarding point №3, I've added this to has_enough_backends.sh in my k8s deploy:

BACKENDS_COUNT=`echo $BACKENDS |awk -F ',' '{print NF}'`
if [[ "$HEALTHY_BACKENDS" -ne "$BACKENDS_COUNT" ]]; then
  for (( node=0; node<$BACKENDS_COUNT; node++ )); do
    node_state=`pcp_node_info -h localhost -U $PCP_USER -w -n $node | awk '{print $5}'`
    if [[ "$node_state" != "up" ]]; then
      pcp_attach_node -h localhost -U $PCP_USER -w -n $node || echo ">>> Node $node attach failed!"
    fi
  done
fi

This way if some node was marked as down and then went back online, liveness probe will mark it again as up.

alivespirit avatar Jan 03 '19 11:01 alivespirit