pycontrol: closing ESTABLISHED when disabling a node

Hi,

I’m working on mysql-master-ha master failover script, see: https://code.google.com/p/mysql-mas…ver_script

The idea is to disable a node (a dead or deprecated mysql master) and enable another node (a mysql slave newly promoted to master).

The disabling and enabling is already working.

In some cases the old mysql master might still be able to handle connections. To make sure write really only go to a single node, I’d like to kill all existing connections to the old master before enabling the new master. So:

1. disable old master

2. close all connections

3. enable new master

There should only ever be 1 node active in the pool.

Setting a node SESSION_STATUS_FORCED_DISABLED still allows ESTABLISHED connections.

How can I kill them?