Alexander Kukushkin
f494d2ce64
Build Cluster object for ZooKeeper the same way as for Etcd
...
Previous implementation was always setting Cluster.initialize to True.
Also it was throwing ZooKeeperError when there were no members in a
cluster.
Plus BUGFIX of a bug introduced with
https://github.com/zalando/patroni/pull/34 in a `load_members` method.
- data = self.get_node(self.member_path)
+ data = self.get_node(self.members_path + member)
It was always fetching the same node for all cluster members.
Fortunately Etcd doesn't have such problem because we are fetching the
whole cluster directory with one recursive API call.
2015-09-14 11:19:46 +02:00
Oleksii Kliukin
15cd10669d
Change an outdated comment.
2015-09-10 18:04:47 +02:00
Oleksii Kliukin
cd312de252
Fix a flake8 warning.
...
Improve some unit tests by expecting specific exceptions.
2015-09-10 17:15:43 +02:00
Oleksii Kliukin
2377c417e4
Fix etcd and zookeper interactions with initialize key.
...
Fix unittests as well.
2015-09-10 16:05:10 +02:00
Oleksii Kliukin
938b946e55
Merge branch 'master' into feature/cleanup_on_failed_initialization
2015-09-10 15:43:31 +02:00
Oleksii Kliukin
30a9e0f7f5
Move PostgreSQL data directory if init had failed.
...
Prevent treating the incompletely-initialized PostgreSQL cluster
as a valid on restart by forcefully moving the data directory.
I don't want to remove it altogether, since a DBA might decide
to analyze the failed PG cluster in order to resolve the init
issue.
2015-09-10 15:34:29 +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
36cbd34ffc
Fix zookeeper test coverage
2015-09-09 15:59:02 +02:00
Alexander Kukushkin
5bdb18761b
Define initialize, leader, optime and members string constansts in AbstractDCS
...
Also define following properties:
* initialize_path
* members_path
* member_path
* leader_path
* leader_optime_path
And replace any occurrences of these strings or client_path calls in a
etcd and zookeeper implementations with given constants and properties.
2015-09-09 15:10:45 +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
Oleksii Kliukin
1c61280d70
Fix path to scripts subdirectory in configuration files.
2015-09-08 16:10:42 +02:00
Oleksii Kliukin
ff499604f0
Act on removal of initialization flag.
...
If initializer node suddenly dies before the initialization is complete,
other nodes should try to take over.
Fix some unittests for etcd and zookeeper and add couple of new ones.
2015-09-08 16:04:54 +02:00
Oleksii Kliukin
92647b7aad
Merge branch 'master' of https://github.com/zalando/patroni into feature/cleanup_on_failed_initialization
2015-09-08 14:54:52 +02:00
Feike Steenbergen
dd8472f639
Tag on github is prefixed with v.
2015-09-08 13:17:36 +02:00
Feike Steenbergen
4d334061b0
Bumped version to 0.2
v0.2
2015-09-08 13:10:19 +02:00
Feike Steenbergen
763e4db949
Bumped version to 0.20
2015-09-08 13:09:58 +02:00
Feike Steenbergen
02137948d0
Merge pull request #29 from zalando/feature/pypi-package-complete
...
Feature/pypi package complete
2015-09-08 12:50:57 +02:00
Alexander Kukushkin
61d1d5a098
Set current version to 0.2
2015-09-08 12:42:12 +02:00
Alexander Kukushkin
fa22d91e05
Move some basic methods implementation into parent exception class
2015-09-08 12:41:48 +02:00
Oleksii Kliukin
b842ed478b
Make sure initialize flag is reset on failure.
...
Cleanup the initialize flag if the initializing node fails
to bootstrap its PostgreSQL database.
Rename dcs.race to initialize, since we only call it for the
initialize flag. Factored out PostgreSQL bootstrapping code
into a separate function.
2015-09-08 12:03:34 +02:00
Feike Steenbergen
496f91fea0
Update README.rst
...
Formatting issue with the header
2015-09-08 11:59:08 +02:00
Feike Steenbergen
28f5839ac2
Make git add part of the release.sh again.
2015-09-07 14:00:05 +02:00
Feike Steenbergen
cdccebd2d1
Point to api for listing of Docker images for Patroni (Issue #14 )
2015-09-07 13:53:48 +02:00
Feike Steenbergen
348e8e8086
Reverted pip installation in Dockerfile
...
As the Dockerfile is there mainly to support developers, we want to build the Dockerfile using the current working
directory instead of a previously released version.
2015-09-07 13:47:05 +02:00
Alexander Kukushkin
5ea0ab70f5
Add patroni.py executable file
2015-09-07 10:37:10 +02:00
Alexander Kukushkin
c9577e1a62
Merge Feike-s and my work on pypi package alltogether
2015-09-06 12:56:13 +02:00
Alexander Kukushkin
1774d6e31a
Merge branches watch-leader-key and package-refactoring
2015-09-05 16:09:28 +02:00
Alexander Kukushkin
3a4a2dbb94
Merge branch 'master' of github.com:zalando/patroni into feature/watch-leader-key
2015-09-05 15:31:37 +02:00
Alexander Kukushkin
ac2740eeb9
Drop unused variable server_version
2015-09-05 15:22:38 +02:00
Alexander Kukushkin
7cce02ae95
Always use pg_xlog_location_diff to calculate bytes written to xlog
...
Drop unused functionality (lsn_to_bytes, bytes_to_lsn)
Revert some changes.
2015-09-05 15:19:17 +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
650e244904
Refactor directory structure in preparation for building pypi-package
2015-09-04 16:06:44 +02:00
Alexander Kukushkin
a69565fc5f
Set Postgresql._SERVER_VERSION only after real connect.
2015-09-04 13:22:44 +02:00
Alexander Kukushkin
c913c8ad92
Calculate xlog bytes with using lsn_to_bytes method
...
This method behaves differently depending on server version and will
allow to use patroni with postgres older than 9.3
2015-09-04 12:11:55 +02:00
Alexander Kukushkin
8b9e99090f
Move lsn_to_bytes and bytes_to_lsn into Postgresql class
...
and make their behavior version specific
2015-09-04 10:41:59 +02:00
Alexander Kukushkin
9361732722
Fix pep8 formatting and unit-tests
2015-09-04 08:29:16 +02:00
Alexander Kukushkin
df06860bde
Merge pull request #23 from pgexperts/93compat
...
93compat
2015-09-04 08:14:13 +02:00
Josh Berkus
5612cd0280
Changed use_slots to be backwards compatible by using config.get() per PR feedback.
2015-09-03 22:20:27 -07:00
Josh Berkus
aeea7196bd
Fixing flake8 issue.
2015-09-03 21:46:06 -07:00
Josh Berkus
6df56fc6cc
Another try at the is_healthiest_node bugfix.
2015-09-03 21:41:33 -07:00
Josh Berkus
2b62adae21
Fixed inherited bug in is_healthiest_node() with LSN position.
2015-09-03 21:22:59 -07:00
Josh Berkus
bdb1454e35
Another commit because flake8 is a huge waste of time.
2015-09-03 21:10:30 -07:00
Josh Berkus
5f4a9ffabb
Text spacing changes in an attempt to get flake8 to stop complaining.
2015-09-03 21:04:42 -07:00
Josh Berkus
f5627a498e
Fixed test_postgresql.py to include use_slots.
2015-09-03 18:41:30 -07:00
Josh Berkus
f2338e074c
Added documentation, sample config for optional replication slots.
2015-09-03 18:16:44 -07:00
Josh Berkus
2b801a3ccc
Next 9.3 compatibility commit. Removed pg_lsn, since it's not available in 9.3.
2015-09-03 18:03:25 -07:00
Josh Berkus
330f9023ee
Interim commit to make replication slots optional for 9.3 users.
2015-09-03 17:46:41 -07:00
Alexander Kukushkin
50420771ce
Retry when executing take_leader method.
2015-09-03 16:53:15 +02:00
Alexander Kukushkin
2f6399de27
More unit-tests for etcd
2015-09-03 16:35:58 +02:00
Alexander Kukushkin
66286733b2
Enable retry functionality for etcd with default deadline=10 seconds
2015-09-03 15:03:09 +02:00