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

Commit45c8378

Browse files
committed
fix formatting, make standby.First and standby.Any classes available from top level module
1 parent60b2b1c commit45c8378

File tree

3 files changed

+27
-21
lines changed

3 files changed

+27
-21
lines changed

‎testgres/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,7 @@
2424
get_bin_path, \
2525
get_pg_config, \
2626
get_pg_version
27+
28+
from .standbyimport \
29+
First, \
30+
Any

‎testgres/node.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1040,8 +1040,10 @@ def set_synchronous_standbys(self, standbys):
10401040
10411041
Example::
10421042
1043+
from testgres import get_new_node, First
1044+
10431045
master = get_new_node().init().start()
1044-
with master.replicate.start() as standby:
1046+
with master.replicate().start() as standby:
10451047
master.append_conf("synchronous_commit = remote_apply")
10461048
master.set_synchronous_standbys(First(1, [standby]))
10471049
master.restart()

‎testgres/standby.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@
66
@six.python_2_unicode_compatible
77
classFirst:
88
"""
9-
Specifies a priority-based synchronous replication and makes transaction
10-
commits wait until their WAL records are replicated to ``num_sync``
11-
synchronous standbys chosen based on their priorities.
12-
13-
Args:
14-
sync_num (int): the number of standbys that transaction need to wait
15-
for replies from
16-
standbys (:obj:`list` of :class:`.PostgresNode`): the list of standby
17-
nodes
18-
"""
9+
Specifies a priority-based synchronous replication and makes transaction
10+
commits wait until their WAL records are replicated to ``num_sync``
11+
synchronous standbys chosen based on their priorities.
12+
13+
Args:
14+
sync_num (int): the number of standbys that transaction need to wait
15+
for replies from
16+
standbys (:obj:`list` of :class:`.PostgresNode`): the list of standby
17+
nodes
18+
"""
1919

2020
def__init__(self,sync_num,standbys):
2121
self.sync_num=sync_num
@@ -29,16 +29,16 @@ def __str__(self):
2929
@six.python_2_unicode_compatible
3030
classAny:
3131
"""
32-
Specifies a quorum-based synchronous replication and makes transaction
33-
commits wait until their WAL records are replicated to at least ``num_sync``
34-
listed standbys. Only available for Postgres 10 and newer.
35-
36-
Args:
37-
sync_num (int): the number of standbys that transaction need to wait
38-
for replies from
39-
standbys (:obj:`list` of :class:`.PostgresNode`): the list of standby
40-
nodes
41-
"""
32+
Specifies a quorum-based synchronous replication and makes transaction
33+
commits wait until their WAL records are replicated to at least ``num_sync``
34+
listed standbys. Only available for Postgres 10 and newer.
35+
36+
Args:
37+
sync_num (int): the number of standbys that transaction need to wait
38+
for replies from
39+
standbys (:obj:`list` of :class:`.PostgresNode`): the list of standby
40+
nodes
41+
"""
4242

4343
def__init__(self,sync_num,standbys):
4444
self.sync_num=sync_num

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp