Commit Graph
119 Commits
Author SHA1 Message Date
Alexander Kukushkin 71fce312c2 Enforce flake8 check 2015-07-10 10:53:04 +02:00
Alexander Kukushkin c49580d6a7 Rename governor into patroni 2015-07-08 10:37:35 +02:00
Alexander Kukushkin 54400c6dec Merge branch 'multidcs' of github.com:CyberDem0n/governor into feature/multidcs
Conflicts:
	governor.py
	tests/test_governor.py
	tests/test_postgresql.py
2015-07-08 08:47:26 +02:00
Alexander Kukushkin 1531304baa return result of last_operation as a string 2015-07-07 12:23:06 +02:00
Alexander Kukushkin c7210d35ff Merge pull request #27 from CyberDem0n/master
BUGFIX: keep list of replication slots on slaves empty
2015-06-25 14:20:10 +02:00
Alexander Kukushkin 9732106e5d BUGFIX: keep list of replication slots on slaves empty
Otherwise slaves accumulate wal files...
2015-06-25 14:01:06 +02:00
Alexander Kukushkin 10d992a974 Merge pull request #26 from CyberDem0n/master
Reduce amount of writes into etcd
2015-06-24 16:39:50 +02:00
Alexander Kukushkin b7c73fdba8 Rename hostname to name in a Member 2015-06-23 14:07:00 +02:00
Oleksii Kliukin 8ab7717f13 increase test coverage for the changes in postgresql.py 2015-06-05 10:03:42 +02:00
Oleksii Kliukin cdc7526216 Merge branch 'master' into feature/awstags 2015-06-05 09:50:17 +02:00
Oleksii Kliukin 553b26f385 call on_change_callback only if it has been set. 2015-06-05 09:01:42 +02:00
Oleksii Kliukin e06cd49deb autodetect the host role during start from the existence of recovery.conf. 2015-06-03 16:13:03 +02:00
Oleksii Kliukin eb3a120db1 add code to set tags on AWS objects (instances and EBS storage), as well as an ability for the postgres state_handler to call a callback when the state is changed, and use the new AWS code in a callback. 2015-06-03 12:56:00 +02:00
Alexander Kukushkin 5cceac7621 Merge branch 'master' of github.com:CyberDem0n/governor into features/refactoring
Conflicts:
	tests/test_postgresql.py
2015-06-02 12:38:45 +02:00
Alexander Kukushkin d9fbbf3ae9 Make pg_hba section more compact 2015-06-02 12:37:26 +02:00
Alexander Kukushkin 88631e14fa Merge branch 'master' of github.com:CyberDem0n/governor into features/refactoring
Conflicts:
	helpers/postgresql.py
	tests/test_postgresql.py
2015-06-02 10:28:28 +02:00
Alexander Kukushkin f9ce29d49f rename address to conn_url in a Member obj
and introduce new field: api_url
2015-06-02 08:52:34 +02:00
Alexander Kukushkin bacd05d99e Determine preferable local address to connect through.
If listen contains '*' or 0.0.0.0 - connect via localhost
In all other cases pick the first one.
2015-06-01 17:00:15 +02:00
Alexander Kukushkin efccd777b2 rename pid_path to postmaster_pid 2015-06-01 16:47:56 +02:00
Alexander Kukushkin 1bcc2b5fa6 Extend postgres?.yml with pg_hba section to give possibility to customize pg_hba.conf 2015-06-01 16:05:35 +02:00
Alexander Kukushkin ccdff5ea99 Merge branch 'master' of github.com:CyberDem0n/governor into features/refactoring
Conflicts:
	helpers/postgresql.py
	tests/test_postgresql.py
2015-06-01 14:14:53 +02:00
Alexander Kukushkin adcc7ac256 Try to avoid "double" promotion.
Also check presence of trigger_file on master after promotion when
pg_is_in_recovery() = false and if it is there - remove it.
Plus check presence of trigger_file on a new slave (after running
pg_basebackup) and if it is there - also remove it.
2015-06-01 13:48:44 +02:00
Alexander Kukushkin 939254021e Code cleanup: do not modify os.environ but pass copy of it to subprocess.call 2015-06-01 11:03:06 +02:00
Alexander Kukushkin b85262637d Bugfix: do not create replication slot for master 2015-06-01 09:20:24 +02:00
Alexander Kukushkin 5fcb19b817 Merge branch 'sleep-sigchld' of github.com:CyberDem0n/governor into features/refactoring
Conflicts:
	tests/test_governor.py
2015-05-28 15:55:03 +02:00
Alexander Kukushkin aa486194ae Wrap time.sleep into wrapper function
In case if it was interrupted by SIGCHLD but scheduled awake time is not
reached it will continue sleeping. For all other signals behaviuor is
not changed.
2015-05-28 15:47:51 +02:00
Alexander Kukushkin b163a8896b Merge branch 'restapi' of github.com:CyberDem0n/governor into features/refactoring
Conflicts:
	helpers/postgresql.py
2015-05-27 11:20:51 +02:00
Alexander Kukushkin 56a9f52a15 Replace os.system with subprocess.call 2015-05-27 11:16:16 +02:00
Alexander Kukushkin 8cc0aa90b1 Fix typos when passing connection parameters to psycopg2. 2015-05-26 10:39:16 +02:00
Oleksii Kliukin 7217d0b0c1 Fix typos when passing connection parameters to psycopg2. 2015-05-26 10:35:42 +02:00
Alexander Kukushkin bbf1110518 Merge branch 'restapi' of github.com:CyberDem0n/governor into features/refactoring
Conflicts:
	governor.py
	helpers/postgresql.py
	postgres0.yml
	postgres1.yml
	tests/test_postgresql.py
2015-05-26 09:56:35 +02:00
Alexander Kukushkin 518ef68a53 Use connect_timeout=3s and statement_timeout=2s everywhere (even for local connections) 2015-05-26 09:19:20 +02:00
Alexander Kukushkin ce267d9f1e query method will retry only in case of communication error 2015-05-24 09:01:23 +02:00
Alexander Kukushkin f53c369c69 Connect timeout 5 seconds for psycopg2
Refactored query and is_healthiest_node methods
query method wont retry more then 3 times if OperationalError raised
is_healthiest_node takes into account that one of the nodes could be
still a master
2015-05-23 20:21:13 +02:00
Alexander Kukushkin b00846affc Merge branch 'master' of github.com:CyberDem0n/governor into features/refactoring
Conflicts:
	helpers/postgresql.py
2015-05-22 12:26:55 +02:00
Alexander Kukushkin 09163ac454 If there is no connect_address defined in yml file use address from listen as a fallback 2015-05-22 12:03:43 +02:00
Alexander Kukushkin 4a4d9b85e5 Make sure that there is the new line at the end of pg_hba.con 2015-05-22 11:23:11 +02:00
Alexander Kukushkin 5d9a3d46a2 Format according to pep8 2015-05-20 18:18:45 +02:00
Oleksii Kliukin becce1dcf0 Merge branch 'master' of https://github.com/zalando/governor into s3_backups 2015-05-20 17:09:39 +02:00
Oleksii Kliukin 363b3c7122 Merge pull request #11 from CyberDem0n/master
some simple tests
2015-05-20 16:55:27 +02:00
Oleksii Kliukin 7dd1e295ca re-add the encoding parameter to initdb. 2015-05-20 16:31:26 +02:00
Oleksii Kliukin 1c1a15908c use governor yaml parameters and not environment variables to configure backups with WAL-E. 2015-05-20 11:47:20 +02:00
Oleksii Kliukin 8a36f17d21 retry with pg_basebackup if one cannot get data from WAL-E. 2015-05-20 11:47:20 +02:00
Oleksii Kliukin 3898610ea3 Put back the S3/pg_basebackup condition after testing. 2015-05-20 11:47:20 +02:00
Oleksii Kliukin 4af752d668 revert the S3/pg_basebackup choice to unconditionally prefer S3 for testing purposes. 2015-05-20 11:47:20 +02:00
Oleksii Kliukin 2efa97334b returned the choice between S3 and pg_basebackup based on diff_in_bytes 2015-05-20 11:47:20 +02:00
Oleksii Kliukin e02eec91bf save/restore both postgresql.conf and pg_hba.conf for WAL-e backup. 2015-05-20 11:47:20 +02:00
Oleksii Kliukin 42dfaaab3f write pg_hba.conf for the replica initialized from WAL-E. Temporarily use WAL-e always as a mean to create replica for testing purposes. 2015-05-20 11:47:20 +02:00
Oleksii Kliukin 8a6a7b4cea fix a typo. 2015-05-20 11:47:20 +02:00
Oleksii Kliukin 75b30d8014 save postgresql.conf not only on initdb, but on any start of the server. 2015-05-20 11:47:19 +02:00