CheckpointNow forces the checkpointer to send a checkpoint, and blocks until it has finished.
()
| 228 | |
| 229 | // CheckpointNow forces the checkpointer to send a checkpoint, and blocks until it has finished. |
| 230 | func (c *Checkpointer) CheckpointNow() { |
| 231 | if c == nil { |
| 232 | return |
| 233 | } |
| 234 | |
| 235 | c.lock.Lock() |
| 236 | defer c.lock.Unlock() |
| 237 | |
| 238 | base.TracefCtx(c.ctx, base.KeyReplicate, "checkpointer: running") |
| 239 | |
| 240 | seq := c._updateCheckpointLists() |
| 241 | if seq == nil { |
| 242 | return |
| 243 | } |
| 244 | |
| 245 | base.InfofCtx(c.ctx, base.KeyReplicate, "checkpointer: calculated seq: %v", seq) |
| 246 | err := c._setCheckpoints(seq) |
| 247 | if err != nil { |
| 248 | base.WarnfCtx(c.ctx, "couldn't set checkpoints: %v", err) |
| 249 | } |
| 250 | } |
| 251 | |
| 252 | // Stats returns a copy of the checkpointer stats. Intended for test use - non-test usage may have |
| 253 | // performance implications associated with locking |