Commit Graph
17 Commits
Author SHA1 Message Date
Alexander Kukushkin 0c040b8ce2 Merge branch 'master' of github.com:compose/governor
Conflicts:
	governor.py
	helpers/etcd.py
	helpers/ha.py
	helpers/postgresql.py
2015-05-13 18:01:01 +02:00
Alexander Kukushkin d25ad17c32 Add support of python3 2015-05-13 14:53:23 +02:00
Christopher Winslett 2c69074652 move stale protection from is_healthy to is_healthiest to allow stale secondaries to rejoin cluster 2015-05-12 18:29:54 -07:00
Christopher Winslett 557bad37cd ensure a stale Postgres does not become leader 2015-05-12 18:11:12 -07:00
Alexander Kukushkin 281b0b8455 Bugfix in has_lock: sometimes leader can be undefined 2015-05-12 11:07:52 +02:00
Alexander Kukushkin 9dcbc75fd2 Bugfix. It wasn't possible to start the old cluster if all its members were shutdown.
Basically this is rollback to the original decision tree with the small exception:
1 - If leader is defined and it's not me - then slave would be started immidiately
with the correct recovery conf.
2 - If leader is defined in and it's my host, then it will start instance in
readonly (but without primary_conninfo in recovery.conf)
3 - And the third case - if the leader is not defined - it also will start
instance in readonly, without primary_conninfo.
After performing 2 or 3 it will perform usual decision tree.
2015-05-12 10:19:45 +02:00
Alexander Kukushkin e2faf641d5 Start slave with the correct recovery.conf on governor start
Also governor is able to pick up already running master and slave
instances without restarting them.
In case is you have a lock and postgres is not running behaviour remains
the same: it will start master in read only mode and then promote if it
still has the lock.
2015-05-11 16:50:21 +02:00
Alexander Kukushkin eb1721f65f Minimize amount of requests to etcd 2015-05-11 15:15:08 +02:00
Alexander Kukushkin 8cfbdcfcd4 Track list of already existing physical replication slots
Drop replication slot when it was removed from etcd.
Execute pg_create_physical_replication_slot only when something new appeared in etcd.
2015-05-11 09:44:57 +02:00
Alexander Kukushkin 588c951a86 Return True after success call of update_leader and check return code 2015-05-11 08:48:51 +02:00
Alexander Kukushkin 72010f68cc Bugfix: two calls has_lock and update_lock are not atomic
Having a lock a few moments ago, doesn't mean that you will be able to
update it.
2015-05-08 16:21:09 +02:00
Alexander Kukushkin c75bb2b297 Format code according to pep8 2015-05-06 14:39:15 +02:00
Christopher Grim b979c12c9d Use timestamped logs 2015-04-03 17:27:47 -04:00
Christopher Winslett d07572e80e add a restarter to the ha loop 2015-03-19 08:46:14 -07:00
Christopher Winslett 0d75152d54 make healthiest node work 2015-03-16 09:47:52 -07:00
Christopher Winslett 450b9912d7 clean up some debugging statements 2015-03-16 08:30:15 -07:00
Christopher Winslett 3749883328 first commit 2015-03-15 23:16:48 -07:00