Increments the _sync:seq document. Retry handling provided by bucket.Incr. Expects sequenceAllocator.mutex to be held to ensure consistent LastSequenceReservedValue updates.
(numToReserve uint64)
| 387 | // Increments the _sync:seq document. Retry handling provided by bucket.Incr. |
| 388 | // Expects sequenceAllocator.mutex to be held to ensure consistent LastSequenceReservedValue updates. |
| 389 | func (s *sequenceAllocator) _incrementSequence(numToReserve uint64) (uint64, error) { |
| 390 | value, err := s.datastore.Incr(s.metaKeys.SyncSeqKey(), numToReserve, numToReserve, 0) |
| 391 | if err != nil { |
| 392 | return value, err |
| 393 | } |
| 394 | s.dbStats.SequenceIncrCount.Add(1) |
| 395 | s.dbStats.SequenceReservedCount.Add(int64(numToReserve)) |
| 396 | s.dbStats.LastSequenceReservedValue.Set(int64(value)) |
| 397 | return value, nil |
| 398 | } |
| 399 | |
| 400 | // ReleaseSequence writes an unused sequence document, used to notify sequence buffering that a sequence has been allocated and not used. |
| 401 | // Sequence is stored as the document body to avoid null doc issues. |
no test coverage detected