We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parenteee6665 commit87a0491Copy full SHA for 87a0491
testgres/pubsub.py
@@ -186,12 +186,19 @@ def catchup(self, username=None):
186
Args:
187
username: remote node's user name.
188
"""
189
-query="""
190
- select pg_current_wal_lsn() - replay_lsn = 0
191
- from pg_catalog.pg_stat_replication where application_name = '{}'
192
- """.format(self.name)
193
194
try:
+pub_lsn=pub.node.execute(query="select pg_current_wal_lsn()::text from pg_catalog.pg_stat_replication",
+dbname=None,
+username=None)# yapf: disable
+# create dummy xact
195
+pub.node.execute(query="select txid_current()",dbname=None,username=None)
196
+query="""
197
+ select {} - replay_lsn <= 0
198
+ from pg_catalog.pg_stat_replication where application_name = '{}'
199
+ """.format(pub_lsn,self.name)
200
+
201
202
# wait until this LSN reaches subscriber
203
self.pub.node.poll_query_until(
204
query=query,