Commit Graph
787 Commits
Author SHA1 Message Date
Alexander Kukushkin a875e93f2e Merge branch 'master' of github.com:zalando/patroni into feature/scheduled_failover_squashed 2016-02-17 12:14:10 +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 0710bdfead directory could disappear after successfull call of isdir 2016-02-15 16:01:11 +01:00
Alexander Kukushkin 1bc22727d5 patroni/postgresql.py
directory could disappear after successfull call of isdir
2016-02-15 14:50:59 +01:00
Alexander Kukushkin 3d4fdea8d5 remove unused import 2016-02-15 13:46:53 +01:00
Alexander Kukushkin 31bad6df49 revert some changes which changed functionality of original code 2016-02-15 13:41:50 +01:00
Alexander Kukushkin 58508c3404 remove uneeded code 2016-02-12 16:57:56 +01:00
Alexander Kukushkin b973ed7e4f improve test coverage 2016-02-12 16:52:26 +01:00
Alexander Kukushkin 544ecdc1be make quantifiedcode and codacy happier 2016-02-12 15:53:24 +01:00
Alexander Kukushkin ab0ef91f24 Improve quality of code by resolving issues found by quantifiedcode and codacy 2016-02-12 14:52:23 +01:00
Alexander Kukushkin 36aef07738 Merge branch 'master' of github.com:zalando/patroni into codequality 2016-02-12 12:33:02 +01:00
Alexander Kukushkin df9b8fed2e Improve quality of code by resolving issues found by quantifiedcode and codacy 2016-02-12 12:23:49 +01:00
Feike Steenbergen 0c2efeb7a7 Change default http status code to 500.
Instead of returning 503 (Service Unavailable) we no default to returning 500 (Internal Server Error).
2016-02-11 09:01:44 +01:00
Feike Steenbergen d6c9eb0791 Merge pull request #135 from zalando/feature/setsid
Create new session and set the process group ID for the postmaster
2016-02-10 16:59:59 +01:00
Feike Steenbergen d530133f62 Fixes #133 2016-02-10 16:33:47 +01:00
Alexander Kukushkin 7b524bc557 Create new session and set the process group ID for the postmaster
Otherwice it was receiving signal when you pressed Ctrl+C in the
terminal where patroni is running.
2016-02-10 14:51:20 +01:00
Feike Steenbergen 854ad293c5 Scheduled failover: Add requirements 2016-02-10 14:26:25 +01:00
Feike Steenbergen 1e2fdac891 Scheduled Failover tests
Add tests for the scheduled failover feature, also add more and better tests for patronictl.
2016-02-10 14:19:41 +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
Feike Steenbergen 37315903fa Implement scheduled failover.
Scheduled failover allows scheduling of a failover in the future. It does this by writing
a failover key in the DCS which contains the scheduled failover time.
The reason to allow a scheduled failover, is that it does not require one to use a
scheduler (e.g. cron) to schedule such a failover. One of the issues with using
a scheduler is that it may need to authenticate itself. With scheduled failover the authentication
takes place during the scheduling, not during the actual failover.

To allow the time of failover to be expressed, the failover key has changed its format; the old format however
can still be used. The new format expects the failover key to be a json-document with relevant
keys set. We need the timestamp specified to be time zone aware and to be expressed unambigiously, e.g. ISO 8601.
2016-02-10 14:04:14 +01:00
Alexander Kukushkin b4af126bc3 Apply superuser name and password when doing checkpoint 2016-02-10 13:50:05 +01:00
Alexander Kukushkin ad17b2070a Create superuser with the name specified in config file
And later use this name to connect to the cluster
2016-02-10 12:37:34 +01:00
Oleksii Kliukin 9d4a85e461 Merge pull request #131 from zalando/bugfix/superuser_username
Bugfix/superuser username
2016-02-10 10:48:03 +01:00
Oleksii Kliukin 435eeeb85d Add postgres2.yml as well. 2016-02-10 10:30:05 +01:00
Oleksii Kliukin a513893a19 Really fix the sample configuration files. 2016-02-10 10:29:21 +01:00
Oleksii Kliukin 7ab366a735 Fix psycopg2 username/user confusion.
Make sure username is translated into the user when calling
psycopg2.connect. Also, fix the sample configuration files to use
username everywhere.
2016-02-10 10:26:22 +01:00
Oleksii Kliukin d426a795c3 Merge pull request #122 from zalando/feature/replica_without_the_master
Run replicas without the master
2016-02-04 21:32:17 +01:00
Oleksii Kliukin 09ecd1cbec Fix another issue with replication slots.
Do not try to create replication slots on the replica for the
member that wants to replicate from it if the member's currently
holds the master role.

Remove a debug message.
2016-02-04 19:27:26 +01:00
Oleksii Kliukin 03b56ae5b9 Code refactoring per review by Alex Shulgin.
In particular, rename most of the functions that have leader
in the name if they can be called in the context where the
leader is None.
2016-02-04 19:14:22 +01:00
Oleksii Kliukin 5284a2144d Add maintainers file. 2016-02-04 18:55:02 +01:00
Oleksii Kliukin 1a87bbd830 Fix handling of replication slots on the master.
Master shouldn't keep a replication slot for the members that
replicate from other members instead of the master (replicatefrom).
Otherwise, the master will keep collecting WAL segments that won't
be requested ever. Of course, if the destination of replicatefrom
is not part of the cluster, master should create the slot.
2016-02-04 15:31:22 +01:00
Oleksii Kliukin 458f12f8a2 Rename the badly named parameter. 2016-02-04 12:24:31 +01:00
Feike Steenbergen 642ffe5151 Merge pull request #126 from zalando/feature/docker_improvements
Docker improvements.
2016-02-04 11:21:00 +01:00
Feike Steenbergen 600e3fe853 Merge pull request #124 from zalando/bugfix/wrong-username
Bugfix: Ensure to inject the superuser username when connecting.
2016-02-03 17:06:52 +01:00
Feike Steenbergen 29668556db Merge pull request #112 from zalando/feature/patronictl_password
Feature/patronictl password
2016-02-03 17:03:49 +01:00
Feike Steenbergen af0db5916d Docker improvements.
Latest greatest upstream (PostgreSQL 9.5, etcd 2.2.5)
Install python packages using requirements file (vs installing from apt-get).
2016-02-03 17:00:20 +01:00
Feike Steenbergen 7db5ec1269 Revert global Docker changes 2016-02-03 16:46:30 +01:00
Feike Steenbergen a5207e7d57 Superuser specification: only overwrite values if specified. 2016-02-01 14:58:40 +01:00
Feike Steenbergen b724757b8a Bugfix: Ensure to inject the superuser username when connecting.
When running patroni with a superuser different than the os-user, the connection
was being established using the os-username. This fixes this.
2016-02-01 14:53:55 +01:00
Feike Steenbergen 1a8eaf8b93 Spelling: Even spelling can be tested 2016-02-01 13:02:21 +01:00
Feike Steenbergen 1d689d1e27 Spelling 2016-02-01 12:54:23 +01:00
Feike Steenbergen 989443b4e3 Merge pull request #123 from zalando/feature/api-context
Provide more context for healthchecks and monitoring.
2016-02-01 12:33:08 +01:00
Oleksii Kliukin 2d457ae26a Fix a problem with mutable default arguments.
Also bump up the version of python-etcd in requirements to the
latest one that that does not have https://github.com/jplana/python-etcd/issues/152
2016-02-01 11:37:59 +01:00
Feike Steenbergen bce96df177 Add attributes to Mocked classes 2016-01-29 13:29:51 +01:00
Feike Steenbergen 704b29e686 Provide more context for healthchecks and monitoring.
Include version numbers of both PostgreSQL and patroni for the /patroni endpoint.
Scope is also returned.
2016-01-29 12:55:08 +01:00
Oleksii Kliukin abaef49670 Disable auth in order to use patronictl with the default configuration, remove obsolete replication_methods like. 2016-01-29 09:05:52 +01:00
Oleksii Kliukin d1e54174c7 Make the code slightly more readable. 2016-01-27 13:13:52 +01:00
Oleksii Kliukin 72d30974ad Another attempt at making the Quantifiedcode happy. 2016-01-26 16:22:28 +01:00
Oleksii Kliukin c9de062ef5 declare the test as a static method to make the code analyzing tool happy. 2016-01-26 16:07:17 +01:00
Oleksii Kliukin aa350b7139 Increase the tests coverage. 2016-01-26 15:57:23 +01:00