Feike Steenbergen
c2d46a084e
Include timestamp of last replayed location in api call.
2016-02-05 09:22:38 +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
Oleksii Kliukin
34437550d4
Fix a new flake8 warning (line break before the binary operator)
2016-01-26 15:40:53 +01:00
Oleksii Kliukin
15bec1e28c
Support new replicas without the master.
...
The replication method should have no_master flag set and
support getting the base backup from some external storage
(i.e. S3). At the moment we only support initialization of
replicas in the already existing cluster when no master is
present, since there is no 'one fits all' way to decide whether
to run initidb or wait for the replica data storage to become
available when dealing with the new cluster.
2016-01-26 15:24:32 +01:00
Oleksii Kliukin
70bae1b267
Note multiple PostgreSQL listen addresses.
2016-01-08 16:51:24 +01:00
Oleksii Kliukin
c650dc092e
Follow the node in the replicatefrom if present.
...
Rename the follow_the_leader to just follow, since the node to
be followed is not necessary a leader anymore. Extend the code
that manages replication slots to the non-master nodes if they
are mentioned in at least one replicatefrom tag.
Add the 3rd configuration in order to be able to run cascading
replicas.
2015-12-30 18:33:23 +01:00
Oleksii Kliukin
bf52fa6f57
follow_the_leader unconditionally during recovery.
...
Otherwise, we may 'forget' to start the crashed node.
This fixes the regression from the former behavior introduced
in the previous commit.
2015-12-30 16:05:06 +01:00
Oleksii Kliukin
8ac731788d
Merge branch 'master' into feature/cascading_replicas
2015-12-30 10:46:03 +01:00
Alexander Kukushkin
b77908ce58
Execute tests against python 3.5
2015-12-24 09:59:01 +01:00
Alexander Kukushkin
1b032ab618
stick to the python-etcd=0.4.2 until issues=152 is not fixed
2015-12-24 09:56:24 +01:00
Alexander Kukushkin
41bf010cc1
stick to the python-etcd=0.4.2 until issues=152 is not fixed
2015-12-24 09:54:13 +01:00
Alexander Kukushkin
91a10bf122
Execute tests against python 3.5
2015-12-24 09:51:42 +01:00
Alexander Kukushkin
42a5cf70e6
mock socket.getaddrinfo for patroni-ctl unit tests
2015-12-24 09:49:58 +01:00
Feike Steenbergen
a64c7abdcc
Bugfix: Fixing python-etcd version, as behaviour has changed in newer version.
...
Our current master branch doesn't pass the code coverage test, due to behaviour changes
in upstream python-etcd.
As a bandaid, fix the version for now.
Reference build fail:
https://travis-ci.org/zalando/patroni/jobs/98470121
2015-12-23 09:13:23 +01:00
Feike Steenbergen
feac841aad
Docker: Install python packages via pip only, yaml consistency
2015-12-22 19:49:28 +01:00
Feike Steenbergen
6568c56c85
Patronictl: Add tests to increase coverage, fix regression issue.
2015-12-22 16:21:19 +01:00
Feike Steenbergen
42e0714801
Patronictl: Allow specification of dbname and user, as well as password prompting.
2015-12-22 15:30:49 +01:00
Feike Steenbergen
47007c3331
Dockerfile: Ensure all python packages are available and patronictl is configured
2015-12-22 15:30:11 +01:00
Feike Steenbergen
64e09f7ca7
Patronictl: Prettier error messages by inheriting from ClickException
2015-12-22 15:29:05 +01:00
Oleksii Kliukin
39cbd5f1d6
Unify all follow the leader calls from eventloop.
...
Call normal follow the leader method from HA even during recovery.
This provides a single place that changes recovery.conf, making
it easier to plug in a cascading replica in the future.
Remove an obsolete demote function from PostreSQL module, modified
the tests.
2015-12-11 18:54:38 +01:00
Oleksii Kliukin
a4af9f2a4c
Add replicafrom tag.
2015-12-11 18:54:03 +01:00
Oleksii Kliukin
146d9a688e
Merge pull request #111 from zalando/bugfix/initdb_without_options
...
Fix for the crash due to a missing initidb section in the configurati…
2015-12-11 10:54:27 +01:00
Oleksii Kliukin
b2cd6d9113
Fix for the crash due to a missing initidb section in the configuration file
2015-12-11 10:36:39 +01:00
Oleksii Kliukin
39beb9cbb3
Bump up minor version.
v0.76
2015-12-10 09:51:28 +01:00
Oleksii Kliukin
17250a20aa
Merge pull request #108 from zalando/pg_rewind_manual_failover
...
Call a checkpoint on master before pg_rewind.
2015-12-09 14:13:43 +01:00
Oleksii Kliukin
d0c84c87ba
Fix the formatting, add the missing changes to configuration files.
2015-12-09 13:56:37 +01:00
Oleksii Kliukin
c5285bc293
Call a checkpoint on master before pg_rewind.
...
PostgreSQL does not run a checkpoint during promition.
Since pg_rewind relies on the last checkpoint to get the timeline,
there is a short race condition right after the promotion, when
it can get the timeline wrong and fail. We work around this by
calling the checkpoint manually.
Make sure our test configuration does both archive and recovery.
2015-12-09 13:17:36 +01:00