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

Method removeFromRevLookup

db/revision_cache_lru.go:577–584  ·  view source on GitHub ↗

removeFromRevLookup will only remove the entry from the rev lookup map, if present. Underlying element must stay in list for eviction to work.

(ctx context.Context, docID, revID string, collectionID uint32)

Source from the content-addressed store, hash-verified

575
576// removeFromRevLookup will only remove the entry from the rev lookup map, if present. Underlying element must stay in list for eviction to work.
577func (rc *LRURevisionCache) removeFromRevLookup(ctx context.Context, docID, revID string, collectionID uint32) {
578 key := IDAndRev{DocID: docID, RevID: revID, CollectionID: collectionID}
579 rc.lock.Lock()
580 defer rc.lock.Unlock()
581 // only delete from rev lookup map, if we delete underlying element in list, the elem in the HLV lookup map
582 // will never be evicted leading to potential unbounded growth of HLV lookup map
583 delete(rc.cache, key)
584}
585
586// removeFromCVLookup will only remove the entry from the CV lookup map, if present. Underlying element must stay in list for eviction to work.
587func (rc *LRURevisionCache) removeFromCVLookup(ctx context.Context, docID string, cv *Version, collectionID uint32) {

Callers 1

RemoveRevOnlyMethod · 0.95

Calls 2

LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected