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)
| 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. |
| 577 | func (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. |
| 587 | func (rc *LRURevisionCache) removeFromCVLookup(ctx context.Context, docID string, cv *Version, collectionID uint32) { |
no test coverage detected