Commit Graph
100 Commits
Author SHA1 Message Date
Alexander KukushkinandGitHub ef0b3c2296 Bring all configs to the new format (#265)
The v1.0 has been released more than one month ago and the new version
is coming. It doesn't make a lot of sense to keep configuration files in
the old format anymore.
In addition to that I've also commented out all the lines enabling and
configuring "archiving" to avoid incidents like here:
https://github.com/zalando/patroni/issues/264
2016-08-23 11:46:16 +02:00
Alexander KukushkinandGitHub fa7aa71092 Always call on_start callback when starting Patroni (#262)
When Patroni was "joining" already running postgres it was not calling
callbacks, what in some cases causing issues (callback could be used to
change routing/load-balancer or assign/remove floating (service) ip.

In addition to that we should `start` postgres instead of `restart`-ing
it when doing recovery, because in this case 'on_start' callback should
be called, instead of 'on_restart'
2016-08-18 09:35:13 +02:00
Alexander KukushkinandGitHub 8ef7178ddf Refactor code dealing with database connection string/params (#255)
In the original code we were parsing/deparsing url-style connection
strings back and forth. That was not really resource greedy but rather
annoying. Also it was not really obvious how to switch all local
connections to unix-sockets (preferably).

This commit isolates different use-cases of working with connection
strings and minimizes amount of code parsing and deparsing them. Also it
introduces one new helper method in the `Member` object - `conn_kwargs`.
This method can accept as a parameter dict object with credentials
(username and password). As a result it returns dict object which could
be used by `psycopg2.connect` or for building connection urls for
pg_rewind, pg_basebackup or some other replica creation methods.

Params for local connection are builded in the `_local_connect_kwargs`
method and could be changed to unix-socket later easily.
2016-08-10 10:19:52 +02:00
Alexander KukushkinandGitHub 413a84836b Update etcd topology only after original request succeed (#254)
There is no point to try to update topology until original request is
not performed. Also for us it is more important to execute original
request rather then keep topology of etcd cluster in sync.

In addition to that implement the same retry-timeout logic in the
`machines` property which already is used in `api_execute` method.
2016-08-10 10:17:37 +02:00
Alexander KukushkinandGitHub 702ab261a2 Use pgkutil to find dcs modules (#253) 2016-08-10 10:15:55 +02:00
Alexander KukushkinandGitHub 5fe74bec3b Make different kazoo timeouts depend on loop_wait (#243)
* Make different kazoo timeouts dependant on loop_wait

ping timeout ~ 1/2 * loop_wait
connect_timeout ~ 1/2 * loop_wait

Originally these values were calculated from negotiated session timeout
and didn't worked very well, because it was taking significant time to
figure out that connection is dead and reconnect (up to session timeout)
and not giving us time to retry.

* Address the code review
2016-08-10 10:15:09 +02:00
Alexander KukushkinandGitHub 13a9198013 Merge pull request #249 from zalando/travis/python
Travis changed python version to 3.5.2
2016-08-01 12:19:27 +02:00
Alexander KukushkinandGitHub 58ad8399cf Merge pull request #238 from zalando/bugfix/pg_rewind
One more try to fix pg_rewind
2016-07-05 16:25:03 +02:00
Alexander KukushkinandGitHub a19dbfaddf Merge pull request #232 from zalando/bugfix/pg_rewind
Start readonly when holding leader lock
2016-07-04 13:11:35 +02:00
Alexander KukushkinandGitHub 40d48eae76 Merge pull request #237 from zalando/bugfix/etcd-retry
Calculate numer of retries and timeout
2016-07-04 13:11:25 +02:00
Alexander KukushkinandGitHub f9298d30ca Merge pull request #231 from zalando/bugfix/etcd-retry
Fix retry logic in etcd.py
2016-07-04 10:37:55 +02:00
Alexander KukushkinandGitHub e025f335dc Merge pull request #233 from zalando/bugfix/initialize
Initialize key can be present but empty
2016-07-04 09:48:09 +02:00
Alexander KukushkinandGitHub a6d840d6be Merge pull request #234 from zalando/feature/zookeeper-connect-strategy
Implement different connect strategy for zookeeper
2016-07-04 09:47:55 +02:00
Alexander KukushkinandGitHub cd752fea14 Merge pull request #235 from zalando/bugfix/docker-volumes
Volume could be passed to the docker only with absolute path
2016-07-04 09:47:35 +02:00
Alexander KukushkinandGitHub 3f1d06da32 Merge pull request #236 from zalando/bugfix/strtol
bugfix: strtol didn't worked correctly with 1 digit numbers
2016-07-04 09:47:09 +02:00
Alexander KukushkinandGitHub dc27a30800 Merge pull request #230 from zalando/bugfix/pg_rewind
Try to cover as much as possible pg_rewind corner-cases
2016-06-30 12:09:10 +02:00
Alexander KukushkinandGitHub 489ed20331 Merge pull request #229 from zalando/bugfix/env-zookeeper-hosts
Document that every single zookeeper host:port MUST be quoted
2016-06-30 12:09:03 +02:00
Alexander KukushkinandGitHub 0c6a1307da Merge pull request #228 from zalando/bugfix/always-expose-role
bugfix: api must report role=master during pg_ctl stop
2016-06-28 15:24:16 +02:00
Alexander KukushkinandGitHub cae3b8ec1e Merge pull request #226 from zalando/bugfix/sigterm
Setup signal handler before creating dcs
2016-06-28 15:24:05 +02:00
Alexander KukushkinandGitHub 6fdd01a8eb Merge pull request #225 from zalando/feature/confd
sample haproxy templates for confd
2016-06-28 15:23:54 +02:00
Alexander KukushkinandGitHub fe0bc2f3eb Merge pull request #223 from zalando/feature/patronictl-at
Acceptance tests for patronictl
2016-06-28 15:23:44 +02:00
Alexander KukushkinandGitHub 26b475753e Merge pull request #222 from zalando/bugfix/sigterm
SystemExit exception was swallowed in in thread
2016-06-17 11:06:15 +02:00
Alexander KukushkinandGitHub 8aa6e6050a Merge pull request #219 from zalando/bugfix/docker_fixe
Bugfix/docker fixe
2016-06-17 11:06:01 +02:00
Alexander KukushkinandGitHub 17f317665f Merge pull request #221 from zalando/feature/patronictl-auth
patronictl will send authorization header if it is configured
2016-06-16 12:57:14 +02:00
Alexander KukushkinandGitHub 010a2961cb Merge pull request #220 from zalando/feature/patronictl-newconf
Feature/patronictl newconf
2016-06-16 12:56:47 +02:00
Alexander KukushkinandGitHub e29bfaf5cc Merge pull request #218 from zalando/feature/do-not-expose-repl-passwd
Don't expose replication user/passwd in DCS
2016-06-16 12:56:35 +02:00
Alexander KukushkinandGitHub dc6ae7a380 Merge pull request #216 from zalando/feature/dynamic-configuration-docs
Update dynamic_configuration.rst
2016-06-14 10:10:40 +02:00
Alexander KukushkinandGitHub 0a32005cc8 Merge pull request #202 from zalando/feature/dynamic-configuration
Feature/dynamic configuration
2016-06-14 10:10:26 +02:00
Alexander KukushkinandGitHub f2980b13fb Merge pull request #211 from zalando/feature/environment-configuration
Implement possibility to configure Patroni via environment
2016-06-14 10:10:09 +02:00
Alexander KukushkinandGitHub 8d38887ca1 Update dynamic_configuration.rst 2016-06-13 14:20:20 +02:00
Alexander Kukushkin c51039a5e3 Merge pull request #210 from misja/dbname
make dbname and config file configurable
2016-06-09 10:14:28 +02:00
Alexander Kukushkin 96bb2312cb Merge pull request #212 from zalando/feature/split-exhibitor
Split ZooKeeper and Exhibitor
2016-06-09 10:14:20 +02:00
Alexander Kukushkin 5372604170 Merge pull request #213 from zalando/feature/pg_ctl_status
Reimplement pg_ctl status in python
2016-06-09 10:14:13 +02:00
Alexander Kukushkin b65dc9a827 Update ENVIRONMENT.rst 2016-06-08 10:29:37 +02:00
Alexander Kukushkin 10e4e8354b Merge pull request #204 from zalando/bugfix/password-visibility
Remove password from backup connection string
2016-06-06 10:49:29 +02:00
Alexander Kukushkin 789ce297e9 Merge pull request #206 from zalando/bugfix/demote-follow
BUGFIX: demote is already running in a thread
2016-06-06 10:49:19 +02:00
Alexander Kukushkin 619699269b Merge pull request #203 from zalando/bugfix/pg_rewind
Bugfix: pg_rewind can work only with master
2016-05-30 11:01:49 +02:00
Alexander Kukushkin 082b6f818a Merge pull request #201 from zalando/feature/dcs-package
Find and load dcs class implementations dynamically
2016-05-19 14:25:06 +02:00
Alexander Kukushkin 73cd9951af Merge pull request #200 from zalando/feature/tests-refactoring
Mininize number of references to dcs implementations from tests
2016-05-19 10:38:17 +02:00
Alexander Kukushkin 6a9fb4fcec Merge pull request #196 from zalando/feature/write-options-to-postgresql.conf
Write postgres options to postgresql.conf (except listen_addresses and port)
2016-05-13 13:29:23 +02:00
Alexander Kukushkin 8a60c915cf Merge pull request #195 from zalando/bugfix/do-not-remove-data
Remove data directory only if replica creation failed
2016-05-11 12:12:41 +02:00
Alexander Kukushkin 14527c69d1 Merge pull request #194 from zalando/feature/api-request-handler-finish
finish method does not have any arguments
2016-05-10 13:10:32 +02:00
Alexander Kukushkin 5f33cf32f4 Merge pull request #193 from zalando/feature/primary_conninfo-application_name
Set application_name to node name in primary_conninfo
2016-05-10 13:10:19 +02:00
Alexander Kukushkin a615339b48 Merge pull request #192 from zalando/feature/api-sysid-no-errors
Reset _sysid and don't call pg_controldata when restore of backup in progress
2016-05-10 13:10:07 +02:00
Alexander Kukushkin 1a0aefeb63 Merge pull request #191 from zalando/feature/api-tests-request-encode
Encode request body only once in a MockRequest
2016-05-10 13:09:31 +02:00
Alexander Kukushkin ec7779fed6 Merge pull request #188 from zalando/bugfix/python351
urllib3.exceptions.HTTPError fixes for python 3.5.1
2016-04-26 11:55:19 +02:00
Alexander Kukushkin 0c6d259a0a Merge pull request #187 from zalando/feature/zookeeper-rename-variable
Rename me->member (variable name was too confusing)
2016-04-22 16:10:32 +02:00
Alexander Kukushkin e275a34f6a Merge pull request #183 from zalando/feature/api-refactoring
Refactor api.py
2016-04-22 13:47:14 +02:00
Alexander Kukushkin 3e32c226c0 Merge pull request #185 from zalando/feature/noloadbalance
Implement noloadbalance support
2016-04-22 10:31:20 +02:00
Alexander Kukushkin 578bd606cc Merge pull request #179 from zalando/bugfix/recovery-conf
Append values from postgresql.recovery_conf to recovery.conf
2016-04-20 16:45:56 +02:00
Alexander Kukushkin 2ba1b5e206 Merge pull request #171 from zalando/feature/pg_rewind_unconditionally
Remove restrictions on running pg_rewind.
2016-04-20 11:22:39 +02:00
Alexander Kukushkin 56f9366aa5 Merge pull request #176 from zalando/feature/get_dcs
Refactor patroni/ctl.py
2016-04-20 10:29:05 +02:00
Alexander Kukushkin bd27669bec Merge pull request #173 from zalando/feature/travis-build-matrix
Disable sudo, reshuffle travis tasks and introduce caching
2016-04-15 09:35:04 +02:00
Alexander Kukushkin c6cc731bf0 Merge pull request #166 from zalando/feature/clonefrom
Correct implementation of 'clonefrom' feature
2016-04-10 10:33:18 +02:00
Alexander Kukushkin 2c3f38f522 Merge pull request #170 from zalando/bugfix/patronictl-output_members
In some cases output_members function was showing cluster=None
2016-04-10 10:32:59 +02:00
Alexander Kukushkin 836cf3a1b8 Merge pull request #169 from jankeirse/master
Add KillMode to avoid issues when restarting
2016-04-05 17:04:09 +02:00
Alexander Kukushkin 727021306d Merge pull request #164 from zalando/feature/fast-reattach-former-leader
Speed up reattach of former leader to the cluster
2016-03-31 21:57:24 +02:00
Alexander Kukushkin e76f820cb5 Merge pull request #165 from zalando/feature/abc-metaclass
Set metaclass of AbstractDCS with `six` to be python 2&3 compatible
2016-03-31 21:57:12 +02:00
Alexander Kukushkin 454c9dcb33 Merge pull request #163 from zalando/bugfix/zookeeper
Bugfix: In some cases Ha.cluster can be None after calling `get_cluster`
2016-03-24 12:36:25 +01:00
Alexander Kukushkin 786dbcca24 Merge pull request #161 from zalando/feature/remove-unused-code
Remove unused code from unit tests
2016-03-24 08:57:34 +01:00
Alexander Kukushkin 6c0c1b1341 Merge pull request #160 from zalando/feature/failover-candidate
Rename ambiguous `Failover.member` to candidate
2016-03-21 18:00:08 +01:00
Alexander Kukushkin ba1dc49294 Merge pull request #159 from zalando/bugfix/scheduled-failover
Ha loop was writing into scheduled_at during "manual_failover"
2016-03-18 13:38:57 +01:00
Alexander Kukushkin 92394598c7 Merge pull request #156 from zalando/feature/delete-cluster-iface
Implement `delete_cluster` interface in for all available dcs
2016-03-18 08:54:09 +01:00
Alexander Kukushkin 780c2bc594 Merge pull request #155 from zalando/bugfix/python-etcd-0.4.3
Migrate to python-etcd 0.4.3
2016-03-14 10:56:19 +01:00
Alexander Kukushkin 70742e6aba Merge pull request #139 from zalando/codequality
remove unused code
2016-02-23 13:24:53 +01:00
Alexander Kukushkin 61feb47da8 Merge pull request #137 from LappleApple/patch-2
Rename LICENCE to LICENSE
2016-02-17 13:33:05 +01:00
Alexander Kukushkin f131961d8b Merge pull request #136 from zalando/codequality
Improve quality of code by resolving issues found by quantifiedcode and codacy
2016-02-17 09:26:21 +01:00
Alexander Kukushkin 50512fef45 Merge pull request #132 from zalando/bugfix/superuser_username
Create superuser with the name specified in config file
2016-02-10 14:10:28 +01:00
Alexander Kukushkin 57f19fb149 Merge pull request #80 from zalando/feature/nofailover
Feature/nofailover
2015-11-16 10:21:56 +01:00
Alexander Kukushkin 96dcb54429 Merge pull request #96 from zalando/bugfix/haproxy_errors
Handle haproxy requests. Improve failover status code.
2015-11-16 10:19:19 +01:00
Alexander Kukushkin 490a54f922 Merge pull request #94 from zalando/feature/initdb
Make it possible to specify custom options for initdb
2015-11-16 10:17:28 +01:00
Alexander Kukushkin 7d59a757fb Merge pull request #93 from zalando/bugfix/parameters
Do not fail when there is no postgresql/parameters section in a config file
2015-11-16 10:13:52 +01:00
Alexander Kukushkin 5290792dff Merge pull request #92 from zalando/feature/api
Call touch_member right after demote and promote.
2015-11-16 10:13:24 +01:00
Alexander Kukushkin 2e5efc6cc9 Merge pull request #75 from zalando/feature/custom-namespace
Make it possible to override default namespace (/service/) from a config file
2015-10-23 16:21:19 +02:00
Alexander Kukushkin 71275fc303 Merge pull request #67 from zalando/feature/api
Manual failover via REST API
2015-10-21 10:55:28 +02:00
Alexander Kukushkin 57ace2009c Merge pull request #66 from zalando/fix/tests
Fix/tests
2015-10-16 10:30:32 +02:00
Alexander Kukushkin 2c863ce9a6 Merge pull request #56 from zalando/feature/manual-failover
Feature: manual failover
2015-10-09 16:23:45 +02:00
Alexander Kukushkin 2fdf02e0be Merge pull request #55 from pgexperts/scripts/init-scripts
Added Upstart job for running patroni under Ubuntu 14.04 or 12.04.
2015-09-30 16:39:07 +02:00
Alexander Kukushkin 83c5416c82 Merge pull request #45 from zalando/feature/query-retry
Refactor Postgresql.query method to use common retry mechanism
2015-09-22 16:53:31 +02:00
Alexander Kukushkin 8a0af6985f Merge pull request #35 from zalando/feature/basic-auth
Basic-auth and SSL support
2015-09-17 16:22:23 +02:00
Alexander Kukushkin 918ac6a87d Merge pull request #39 from zalando/feature/reschedule-next-run
Feature/reschedule next run of ha cycle depending on return value of `watch`
2015-09-17 16:22:12 +02:00
Alexander Kukushkin b9ccd411ed Merge pull request #19 from zalando/feature/faster_shutdown
Feature/faster shutdown
2015-09-17 16:21:59 +02:00
Alexander Kukushkin a8305079c3 Merge pull request #38 from zalando/bugfix/zookeeper
Bugfix/zookeeper
2015-09-15 09:29:18 +02:00
Alexander Kukushkin 30a7d50a56 Merge pull request #34 from zalando/feature/constants-for-key-names
Define initialize, leader, optime and members string constansts in Ab…
2015-09-10 15:33:08 +02:00
Alexander Kukushkin c409ee4d37 Fix formatting in a README.rst 2015-09-09 12:39:48 +02:00
Alexander Kukushkin e90b14cd3b Merge pull request #31 from zalando/bugfix/script_paths
Fix path to scripts subdirectory in configuration files.
2015-09-08 16:25:52 +02:00
Alexander Kukushkin 9894a7ce2a Merge pull request #20 from zalando/feature/retry
Retry requests to configuration store
2015-09-04 16:24:43 +02:00
Alexander Kukushkin df06860bde Merge pull request #23 from pgexperts/93compat
93compat
2015-09-04 08:14:13 +02:00
Alexander Kukushkin ead0b7444f Merge pull request #10 from zalando/feature/python-etcd
python-etcd
2015-09-01 10:04:20 +02:00
Alexander Kukushkin 4940665cea Update dcs.py 2015-08-11 12:01:21 +02:00
Alexander Kukushkin d1e47c8ccf Update README.md 2015-07-15 16:17:38 +02:00
Alexander Kukushkin fcead3aed9 Update README.md 2015-07-15 15:25:20 +02:00
Alexander Kukushkin 6d1a0d2a2c Merge pull request #2 from zalando/feature/exhibitor
Feature/exhibitor
2015-07-13 11:14:59 +02:00
Alexander Kukushkin e2def822b7 Delete haproxy_status.sh 2015-07-08 11:50:16 +02:00
Alexander Kukushkin b36764b517 Update README.md 2015-07-08 11:49:16 +02:00
Alexander Kukushkin 74c3955d34 Merge pull request #29 from zalando/patroni
Rename governor into patroni
2015-07-08 11:24:31 +02:00
Alexander Kukushkin c24087ebd7 Merge pull request #28 from zalando/feature/multidcs
Feature/multidcs
2015-07-08 10:19:40 +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 10d992a974 Merge pull request #26 from CyberDem0n/master
Reduce amount of writes into etcd
2015-06-24 16:39:50 +02:00
Alexander Kukushkin 9fc0fa9f57 Merge pull request #4 from CyberDem0n/etcd-cluster-support
real_ttl method will return -1 when expiration is not defined
2015-06-23 17:16:26 +02:00