File tree 1 file changed +11
-4
lines changed
1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -186,12 +186,19 @@ def catchup(self, username=None):
186
186
Args:
187
187
username: remote node's user name.
188
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
189
194
190
try :
191
+ pub_lsn = pub .node .execute (query = "select pg_current_wal_lsn()::text from pg_catalog.pg_stat_replication" ,
192
+ dbname = None ,
193
+ username = None ) # yapf: disable
194
+ # 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
+
195
202
# wait until this LSN reaches subscriber
196
203
self .pub .node .poll_query_until (
197
204
query = query ,
You can’t perform that action at this time.
0 commit comments