Commit 87ac09a
Use WAIT FOR LSN in PostgreSQL::Test::Cluster::wait_for_catchup()
Replace polling-based catchup waiting with WAIT FOR LSN command when
running on a standby server. This is more efficient than repeatedly
querying pg_stat_replication as the WAIT FOR command uses the latch-
based wakeup mechanism.
The optimization applies when:
- The node is in recovery (standby server)
- The mode is 'replay', 'write', or 'flush' (not 'sent')
For 'sent' mode or when running on a primary, the function falls back
to the original polling approach since WAIT FOR LSN is only available
during recovery.1 parent 488388a commit 87ac09a
1 file changed
+32
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3335 | 3335 | | |
3336 | 3336 | | |
3337 | 3337 | | |
| 3338 | + | |
| 3339 | + | |
| 3340 | + | |
3338 | 3341 | | |
3339 | 3342 | | |
3340 | 3343 | | |
| |||
3347 | 3350 | | |
3348 | 3351 | | |
3349 | 3352 | | |
3350 | | - | |
3351 | | - | |
3352 | | - | |
3353 | 3353 | | |
3354 | 3354 | | |
3355 | 3355 | | |
| |||
3367 | 3367 | | |
3368 | 3368 | | |
3369 | 3369 | | |
| 3370 | + | |
| 3371 | + | |
| 3372 | + | |
| 3373 | + | |
| 3374 | + | |
| 3375 | + | |
| 3376 | + | |
| 3377 | + | |
| 3378 | + | |
| 3379 | + | |
| 3380 | + | |
| 3381 | + | |
| 3382 | + | |
| 3383 | + | |
| 3384 | + | |
| 3385 | + | |
| 3386 | + | |
| 3387 | + | |
| 3388 | + | |
| 3389 | + | |
| 3390 | + | |
| 3391 | + | |
| 3392 | + | |
| 3393 | + | |
| 3394 | + | |
| 3395 | + | |
| 3396 | + | |
| 3397 | + | |
| 3398 | + | |
3370 | 3399 | | |
3371 | 3400 | | |
3372 | 3401 | | |
| |||
0 commit comments