reset performs a reset on the replication by removing the local checkpoint document.
()
| 220 | |
| 221 | // reset performs a reset on the replication by removing the local checkpoint document. |
| 222 | func (arc *activeReplicatorCommon) reset() error { |
| 223 | if arc.state != ReplicationStateStopped { |
| 224 | return fmt.Errorf("reset invoked for replication %s when the replication was not stopped", arc.config.ID) |
| 225 | } |
| 226 | |
| 227 | arc.lock.Lock() |
| 228 | defer arc.lock.Unlock() |
| 229 | |
| 230 | if err := arc.forEachCollection(func(c *activeReplicatorCollection) error { |
| 231 | if err := resetLocalCheckpoint(c.collectionDataStore, arc.CheckpointID); err != nil { |
| 232 | return err |
| 233 | } |
| 234 | c.Checkpointer = nil |
| 235 | return nil |
| 236 | }); err != nil { |
| 237 | return err |
| 238 | } |
| 239 | |
| 240 | return removeLocalStatus(arc.ctx, arc.config.ActiveDB.MetadataStore, arc.statusKey) |
| 241 | } |
| 242 | |
| 243 | // reconnect asynchronously calls replicatorConnectFn until successful, or times out trying. Retry loop can be stopped by cancelling ctx |
| 244 | func (arc *activeReplicatorCommon) reconnect() { |
nothing calls this directly
no test coverage detected