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

Commit76ea566

Browse files
committed
Well, that was even trickier.
1 parentef89ed5 commit76ea566

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

‎testgres/pubsub.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def catchup(self, username=None):
190190
pub_lsn=self.pub.node.execute(query="select pg_current_wal_lsn()",
191191
dbname=None,
192192
username=None)[0][0]# yapf: disable
193-
# create dummy xact
193+
# create dummy xact, as LR replicates only on commit.
194194
self.pub.node.execute(query="select txid_current()",dbname=None,username=None)
195195
query="""
196196
select '{}'::pg_lsn - replay_lsn <= 0
@@ -203,5 +203,17 @@ def catchup(self, username=None):
203203
dbname=self.pub.dbname,
204204
username=usernameorself.pub.username,
205205
max_attempts=LOGICAL_REPL_MAX_CATCHUP_ATTEMPTS)
206+
207+
# Now, wait until there are no tablesync workers: probably
208+
# replay_lsn above was sent with changes of new tables just skipped;
209+
# they will be eaten by tablesync workers.
210+
query="""
211+
select count(*) = 0 from pg_subscription_rel where srsubstate != 'r'
212+
"""
213+
self.node.poll_query_until(
214+
query=query,
215+
dbname=self.pub.dbname,
216+
username=usernameorself.pub.username,
217+
max_attempts=LOGICAL_REPL_MAX_CATCHUP_ATTEMPTS)
206218
exceptExceptionase:
207219
raise_from(CatchUpException("Failed to catch up",query),e)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp