Alexander Kukushkin
01afd09ca2
Migrate to python-etcd 0.4.3
...
Despite this release was very buggy it has really nice features:
* EtcdWatchTimedOut exception is raised when `watch` call timed out
* it supports SRV autodiscovery
Since we already implemented our own SRV discovery this feature is not
really interesting for us, but it solves the problem of having two
requirements files for different python versions, because python-etcd
will install dnspython or dnspython3 as a dependency.
In order to fix https://github.com/jplana/python-etcd/issues/152 and
https://github.com/jplana/python-etcd/pull/154 I had to override
`api_execute` method.
2016-03-12 15:49:42 +01:00
Oleksii Kliukin
e802bba5f9
Merge pull request #151 from zalando/feature/base_backup_from_the_replica
...
First implementation of cloning from the replica.
2016-03-11 16:57:06 +01:00
Oleksii Kliukin
25106e97f3
Merge pull request #146 from zalando/feature/remove-unused-code
...
Feature/remove unused code
2016-03-11 16:47:23 +01:00
Oleksii Kliukin
18f3284bf2
Merge pull request #143 from zalando/bugfix/zookeeper-support-for-ctl
...
Add support for ZooKeeper/Exhibitor DCS URI in patronictl ... -d
2016-03-11 16:45:25 +01:00
Oleksii Kliukin
8b96741e8e
Merge pull request #129 from zalando/feature/xlog_lag_interval
...
Include timestamp of last replayed location in api call.
2016-03-11 16:42:16 +01:00
Alexander Kukushkin
ea59692b82
Merge branch 'master' of github.com:zalando/patroni into feature/remove-unused-code
2016-03-11 15:15:13 +01:00
Oleksii Kliukin
d965d21ada
Unit-tests for clone from the replica.
...
Remove clonefrom function from dcs, since it's not used.
2016-03-11 10:48:58 +01:00
Oleksii Kliukin
805716ed68
Variables and parameters renaming.
...
Previously, "without_leader" suffix was used in the name of methods
and functions that initialize a replica without an active replication
connection, and leader was part of the name for parameters and messages
that require an active replication conneciton. Since we support init
from the members other than the leader, those conventions have to be
changed.
2016-03-11 10:19:00 +01:00
Oleksii Kliukin
9057ddeb7c
First implementation of cloning from the replica.
...
At the moment we just replace the master with the
node at the 'clonefrom' tag if it's present. Master
should be available anyway, otherwise, it will not
even try to do cloning.
Acceptance tests:
https://github.com/zalando/patroni/pull/144/commits
2016-03-10 16:06:31 +01:00
Alexander Kukushkin
5decc61fc8
Merge branch 'master' of github.com:zalando/patroni into bugfix/zookeeper-support-for-ctl
2016-03-07 12:02:57 +01:00
Oleksii Kliukin
ede5661da3
Remove hard-coded values from the failover code.
2016-03-04 19:21:48 +01:00
Oleksii Kliukin
aa844b63d0
Avoid an unhandled exception in the API thread.
...
When receiving a failover request with no data or
non-JSON data, emit a message to the client instead
of crashing.
2016-03-04 19:21:14 +01:00
Alexander Kukushkin
cb38e50ac1
Remove unused code
2016-02-26 08:50:53 +01:00
Alexander Kukushkin
9c12eb671d
Fix unit tests
2016-02-24 12:10:58 +01:00
Oleksandr Shulgin
16b321e0a5
Add dummy cluster name to test_ctl / zookeeper
2016-02-23 17:33:15 +01:00
Oleksandr Shulgin
524cfafbbe
Don't mock get_dcs() for ZK, we are trying to test it
2016-02-23 17:18:16 +01:00
Oleksandr Shulgin
c630b60ca9
Merge remote-tracking branch 'origin/master' into bugfix/zookeeper-support-for-ctl
2016-02-23 17:12:41 +01:00
Oleksandr Shulgin
a1417875a2
Add dummy patronictl tests with ZooKeeper
2016-02-23 17:04:16 +01:00
Alexander Kukushkin
a38af0949b
Merge branch 'master' of github.com:zalando/patroni into feature/xlog_lag_interval
2016-02-23 14:48:49 +01:00
Alexander Kukushkin
ec85e2eb49
make quantifiedcode happier
2016-02-23 12:05:02 +01:00
Alexander Kukushkin
756158a735
make codacy and quantifiedcode happier
2016-02-23 11:59:02 +01:00
Alexander Kukushkin
6b3c4697fc
Remove unused code
2016-02-23 11:49:22 +01:00
Alexander Kukushkin
ce33090c0d
Mock dcs.watch directly instead of using wraper
2016-02-23 11:48:52 +01:00
Alexander Kukushkin
641cc4013e
Mock a few of methods in Postgresql class instead of the whole class
2016-02-23 11:46:49 +01:00
Alexander Kukushkin
dbb3e8308b
Merge branch 'master' of github.com:zalando/patroni into codequality
2016-02-22 19:20:23 +01:00
Oleksii Kliukin
26e1586288
Make the patronictl test provide an input for the schedule, even if it's empty.
2016-02-22 12:20:20 +01:00
Alexander Kukushkin
4038d94c5a
Fix more codacy issues
2016-02-17 14:59:17 +01:00
Alexander Kukushkin
a210cfd1ab
Fix more codacy issues
2016-02-17 14:51:59 +01:00
Alexander Kukushkin
f7d60c61b6
remove unused code
2016-02-17 14:09:00 +01:00
Alexander Kukushkin
de129b733d
Fix unit tests
2016-02-17 12:46:32 +01:00
Alexander Kukushkin
f079a9f308
remove unused code
2016-02-17 12:34:22 +01:00
Alexander Kukushkin
1b9e77fe83
pep8 formatting
2016-02-17 12:34:04 +01:00
Alexander Kukushkin
1b14229da4
Catch TypeError within ha loop not in the unit test
...
In addition to that use sleep function from patroni.utils instead of
time.sleep which is interruptable
2016-02-17 12:18:50 +01:00
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
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
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
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
d530133f62
Fixes #133
2016-02-10 16:33:47 +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
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
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
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
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
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
1a8eaf8b93
Spelling: Even spelling can be tested
2016-02-01 13:02:21 +01:00
Feike Steenbergen
bce96df177
Add attributes to Mocked classes
2016-01-29 13:29:51 +01:00