Check if WAL lag is low enough to proceed to cut-over.
(&self)
| 142 | |
| 143 | /// Check if WAL lag is low enough to proceed to cut-over. |
| 144 | pub fn is_catchup_ready(&self) -> bool { |
| 145 | if let MigrationPhase::WalCatchUp { |
| 146 | current_lsn, |
| 147 | source_lsn, |
| 148 | .. |
| 149 | } = self.phase |
| 150 | { |
| 151 | // Sub-millisecond lag = within 10 LSN entries. |
| 152 | source_lsn.saturating_sub(current_lsn) <= 10 |
| 153 | } else { |
| 154 | false |
| 155 | } |
| 156 | } |
| 157 | |
| 158 | /// Attempt to start Phase 3: Atomic Cut-over. |
| 159 | /// |
no outgoing calls
no test coverage detected