MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / _setCheckpoints

Method _setCheckpoints

db/active_replicator_checkpointer.go:483–510  ·  view source on GitHub ↗
(seq *SequenceID)

Source from the content-addressed store, hash-verified

481}
482
483func (c *Checkpointer) _setCheckpoints(seq *SequenceID) (err error) {
484 seqStr := seq.String()
485 base.TracefCtx(c.ctx, base.KeyReplicate, "setCheckpoints(%v)", seqStr)
486 c.lastLocalCheckpointRevID, err = c.setLocalCheckpointWithRetry(
487 &replicationCheckpoint{
488 LastSeq: seqStr,
489 Rev: c.lastLocalCheckpointRevID,
490 ConfigHash: c.configHash,
491 })
492 if err != nil {
493 return err
494 }
495
496 c.lastRemoteCheckpointRevID, err = c.setRemoteCheckpointWithRetry(
497 &replicationCheckpoint{
498 LastSeq: seqStr,
499 Rev: c.lastRemoteCheckpointRevID,
500 ConfigHash: c.configHash,
501 })
502 if err != nil {
503 return err
504 }
505
506 c.lastCheckpointSeq = *seq
507 c.stats.SetCheckpointCount++
508
509 return nil
510}
511
512// getLocalCheckpoint returns the sequence and rev for the local checkpoint.
513// if the checkpoint does not exist, returns empty sequence and rev.

Callers 1

CheckpointNowMethod · 0.95

Calls 4

TracefCtxFunction · 0.92
StringMethod · 0.65

Tested by

no test coverage detected