2515 Commits
Author SHA1 Message Date
Oleksii Kliukin 1ae19f758b update requirements.txt with boto. 2015-06-05 08:48:57 +02:00
Oleksii Kliukin 3d123b41df add unittests. 2015-06-04 17:19:33 +02:00
Alexander Kukushkin e54fb8c617 Merge pull request #22 from CyberDem0n/master
Process http requests in a threads with ThreadingMixIn
2015-06-04 08:34:56 +02:00
Alexander Kukushkin fad2fbeae0 Import ThreadingMixIn for python3 2015-06-03 16:39:29 +02:00
Alexander Kukushkin 49c9c5dc6b Merge pull request #21 from zalando/features/refactoring
Customize pg_hba.conf via yml configuration file
2015-06-03 16:36:41 +02:00
Oleksii Kliukin ac46600816 more bugfixes. 2015-06-03 16:26:38 +02:00
Alexander Kukushkin aa1fc315ae Process http requests in a threads with ThreadingMixIn 2015-06-03 16:22:05 +02:00
Oleksii Kliukin fb3bf799e9 Autodetect the host role during start from the existence of recovery.conf. Fix some typos. 2015-06-03 16:18:47 +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 1d3a946ffb Fix wrong number of arguments for the EBS instance. 2015-06-03 15:52:35 +02:00
Oleksii Kliukin c68beda75c make sure on role change is called during the initial start of the server. 2015-06-03 15:49:38 +02:00
Oleksii Kliukin 0f518f87e7 fix a typo. 2015-06-03 14:45:02 +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 f9fbe8980f Implement lsn_to_bytes bytes_to_lsn functions 2015-06-02 13:36:36 +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 fca987deda set value of api_url from application_name parameter of conn_url. Reset parameters of conn_url 2015-06-02 09:45:37 +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
Oleksii Kliukin 9ae5998a25 Merge pull request #20 from zalando/features/refactoring
Try to avoid of double promote
2015-06-01 14:43:20 +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 8c4e547d7a Handle KeyboardInterrupt in the main loop 2015-06-01 12:02:46 +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 f8c3582715 Refactor api:
Call is_running only when it's not possible to execute query against
governed postgres.
2015-06-01 10:48:16 +02:00
Alexander Kukushkin b85262637d Bugfix: do not create replication slot for master 2015-06-01 09:20:24 +02:00
Feike Steenbergen f8d4a22921 Merge pull request #19 from zalando/features/refactoring
Wrap time.sleep into wrapper function
2015-05-28 16:07:41 +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 9cd7000d7f Merge branch 'master' of github.com:CyberDem0n/governor 2015-05-28 13:04:49 +02:00
Alexander Kukushkin cd5e589620 Revert previous commit (restore sigchld_handler) 2015-05-28 13:04:21 +02:00
Feike Steenbergen 119c56e5d3 Merge pull request #18 from CyberDem0n/master
Set handler of SIGCHLD to SIG_IGN
2015-05-28 12:43:05 +02:00
Alexander Kukushkin f76f77e964 Ignore SIGCHLD instead of processing it.
This way time.sleep wont be interrupted when some external process is
finished and terminated childs would be reaped automatically.
2015-05-28 12:25:49 +02:00
Feike Steenbergen 3d11fe1fe6 Merge pull request #17 from zalando/features/refactoring
Store api url of each governor together with connect url of postgres
2015-05-28 09:26:09 +02:00
Alexander Kukushkin 01e3beff1c Merge pull request #2 from CyberDem0n/restapi
Restapi
2015-05-27 18:31:42 +02:00
Alexander Kukushkin 9971d214fe Merge branch 'restapi' of github.com:CyberDem0n/governor into features/refactoring
Conflicts:
	governor.py
2015-05-27 14:54:08 +02:00
Alexander Kukushkin bdc4374ae3 connect address for rest api could be different from listen address 2015-05-27 14:51:41 +02:00
Alexander Kukushkin 5a817fad0d Store in etcd endpoint of restapi
In order to have backward compatibility connection url of restapi is
passed as application_name parameter in connection url of database.
Value in etcd will look like:
postgres://user:passwd@host:5432/postgres?application_name=http://host:8080/governor
Sure, this is a hack, but I guess it worth it.
2015-05-27 14:46:35 +02:00
Alexander Kukushkin 77911144c7 Improve test of governor against real config files 2015-05-27 14:44:52 +02:00
Feike Steenbergen c69f9459c6 Merge pull request #16 from zalando/features/refactoring
Replace os.system with subprocess.call
2015-05-27 11:32:53 +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 0cd81a1ecf Merge branch 'restapi' of github.com:CyberDem0n/governor into features/refactoring
Conflicts:
	tests/test_postgresql.py
2015-05-27 11:15:15 +02:00
Alexander Kukushkin 9968a66048 helpers/postgresql.py
Replace os.system with subprocess.call
2015-05-27 11:08:06 +02:00
Alexander Kukushkin 56daec0d6c Api: Bugfix for current_xlog_location in slaves. 2015-05-26 15:53:57 +02:00
Feike Steenbergen ea416d98d7 Api: Bugfix for current_xlog_location in slaves. 2015-05-26 15:40:32 +02:00
Alexander Kukushkin 8cc0aa90b1 Fix typos when passing connection parameters to psycopg2. 2015-05-26 10:39:16 +02:00