Stop stops the replication process and blocks until clean shutdown occurs.
()
| 486 | |
| 487 | // Stop stops the replication process and blocks until clean shutdown occurs. |
| 488 | func (r *LogicalReplicator) Stop() { |
| 489 | r.mu.Lock() |
| 490 | if !r.running { |
| 491 | r.mu.Unlock() |
| 492 | return |
| 493 | } |
| 494 | r.mu.Unlock() |
| 495 | |
| 496 | r.logger.Info("stopping replication...") |
| 497 | r.stop <- struct{}{} |
| 498 | // wait for the channel to be closed, acknowledging that the replicator has stopped |
| 499 | <-r.stop |
| 500 | } |
| 501 | |
| 502 | // beginReplication starts a new replication connection to the primary server and returns it. The LSN provided is the |
| 503 | // last one we have confirmed that we flushed to disk. |
no outgoing calls