Skip to content

Add promote() method #47

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jun 4, 2018
Merged

Add promote() method #47

merged 7 commits into from
Jun 4, 2018

Conversation

zilder
Copy link
Collaborator

@zilder zilder commented Jun 4, 2018

Add missing promote() method which corresponds to pg_ctl's promote mode.

@codecov-io
Copy link

codecov-io commented Jun 4, 2018

Codecov Report

Merging #47 into master will increase coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #47      +/-   ##
==========================================
+ Coverage   97.12%   97.15%   +0.03%     
==========================================
  Files          17       17              
  Lines        1529     1547      +18     
==========================================
+ Hits         1485     1503      +18     
  Misses         44       44
Impacted Files Coverage Δ
tests/test_simple.py 99.81% <100%> (ø) ⬆️
testgres/node.py 97% <100%> (+0.06%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 72d0373...f5fe963. Read the comment docs.

testgres/node.py Outdated
# for versions below 10 `promote` is asynchronous so we need to wait
# until it actually becomes writable
if self._pg_version < '10':
check_query = "SHOW transaction_read_only"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not safe since transactions might be read-only by default.

@@ -683,14 +683,50 @@ def reload(self, params=[]):
_params = [
get_bin_path("pg_ctl"),
"-D", self.data_dir,
"-w", # wait
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

@funbringer funbringer merged commit 24a8f1a into postgrespro:master Jun 4, 2018
@funbringer
Copy link
Collaborator

LGTM, merging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants