Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Replication slots#41

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
funbringer merged 6 commits intopostgrespro:masterfromzilder:repslot
Mar 21, 2018
Merged

Replication slots#41

funbringer merged 6 commits intopostgrespro:masterfromzilder:repslot
Mar 21, 2018

Conversation

zilder
Copy link
Collaborator

No description provided.

@codecov-io
Copy link

codecov-io commentedMar 13, 2018
edited
Loading

Codecov Report

Merging#41 intomaster willincrease coverage by0.24%.
The diff coverage is90%.

Impacted file tree graph

@@            Coverage Diff             @@##           master      #41      +/-   ##==========================================+ Coverage   97.02%   97.27%   +0.24%==========================================  Files          16       16                Lines        1245     1356     +111     ==========================================+ Hits         1208     1319     +111  Misses         37       37
Impacted FilesCoverage Δ
testgres/backup.py96.92% <100%> (ø)⬆️
tests/test_simple.py99.77% <100%> (+0.02%)⬆️
testgres/consts.py100% <100%> (ø)⬆️
testgres/node.py97.55% <84.21%> (+0.28%)⬆️
testgres/enums.py100% <0%> (ø)⬆️
testgres/connection.py95% <0%> (+0.17%)⬆️

Continue to review full report at Codecov.

Legend -Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing data
Powered byCodecov. Last update5bc608e...59dbe42. Read thecomment docs.

).format(slot_name)

self.execute(query=query,
dbname=dbname or default_dbname(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

You don't have to explicitly usedefault_dbname() and such sinceexecute() method is able to handleNone args properly.

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

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

Agree

u"log_statement = {}\n"
u"listen_addresses = '{}'\n"
u"port = {}\n"
u"max_replication_slots = {}\n".format(log_statement,
Copy link
Collaborator

Choose a reason for hiding this comment

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

IMHOmax_replication_slots should be placed underallow_streaming=True, next tomax_wal_senders etc.

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

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

Agree as well

@@ -856,7 +863,24 @@ def backup(self, **kwargs):

return NodeBackup(node=self, **kwargs)

def replicate(self, name=None, **kwargs):
def create_replication_slot(self, slot_name, dbname=None, username=None):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we allow user to choose his ownslot_name? If not, it's better to inline this method.

Copy link
CollaboratorAuthor

@zilderzilderMar 20, 2018
edited
Loading

Choose a reason for hiding this comment

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

If we don't allow this, then it could contradict with logical replication interface (#42) which allows user to choose the subscriber name (which implicitly creates logical replication slot with the same name) voluntarily.

Speaking of inlining, I can callcreate_replication_slot() fromreplicate() ifslot_name != None so that user won't need to call it explicitly. It would be more convenient for user.

Copy link
Collaborator

@funbringerfunbringerMar 20, 2018
edited
Loading

Choose a reason for hiding this comment

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

@zilder You're right, of course. Maybe we'll add a default name generator later.

Speaking of inlining, I can call create_replication_slot() from replicate() if slot_name != None

Sure, that would be nice. It's better to check if slot exists, though.

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

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

It's better to check if slot exists, though.

True

@funbringer
Copy link
Collaborator

Please make sure that code won't be rewritten byyapf.

@funbringerfunbringer merged commitb4051cf intopostgrespro:masterMar 21, 2018
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@funbringerfunbringerfunbringer approved these changes

@ildusildusAwaiting requested review from ildus

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@zilder@codecov-io@funbringer

[8]ページ先頭

©2009-2025 Movatter.jp