- Notifications
You must be signed in to change notification settings - Fork35
Synchronous standbys#46
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
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
60936c5
60b2b1c
45c8378
4a78635
0819053
a1fcfac
6fb7a70
24b0e57
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -24,3 +24,7 @@ | ||
get_bin_path, \ | ||
get_pg_config, \ | ||
get_pg_version | ||
from .standby import \ | ||
First, \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. IMHO those names are too generic to be exported at top level. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I think names are ok but should be used with the of module, like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. @ildus I agree. | ||
Any |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# coding: utf-8 | ||
import six | ||
@six.python_2_unicode_compatible | ||
class First: | ||
""" | ||
Specifies a priority-based synchronous replication and makes transaction | ||
commits wait until their WAL records are replicated to ``num_sync`` | ||
synchronous standbys chosen based on their priorities. | ||
Args: | ||
sync_num (int): the number of standbys that transaction need to wait | ||
for replies from | ||
standbys (:obj:`list` of :class:`.PostgresNode`): the list of standby | ||
nodes | ||
""" | ||
def __init__(self, sync_num, standbys): | ||
self.sync_num = sync_num | ||
self.standbys = standbys | ||
def __str__(self): | ||
return u"{} ({})".format(self.sync_num, u", ".join( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. тут мне кажется лучше добавить ключевое слово first, чтобы было явно | ||
u"\"{}\"".format(r.name) for r in self.standbys)) | ||
@six.python_2_unicode_compatible | ||
class Any: | ||
""" | ||
Specifies a quorum-based synchronous replication and makes transaction | ||
commits wait until their WAL records are replicated to at least ``num_sync`` | ||
listed standbys. Only available for Postgres 10 and newer. | ||
Args: | ||
sync_num (int): the number of standbys that transaction need to wait | ||
for replies from | ||
standbys (:obj:`list` of :class:`.PostgresNode`): the list of standby | ||
nodes | ||
""" | ||
def __init__(self, sync_num, standbys): | ||
self.sync_num = sync_num | ||
self.standbys = standbys | ||
def __str__(self): | ||
return u"ANY {} ({})".format(self.sync_num, u", ".join( | ||
u"\"{}\"".format(r.name) for r in self.standbys)) |