Skip to content

Commit

Permalink
Remove key length assertion LRUHandle::CalcTotalCharge (facebook#6115)
Browse files Browse the repository at this point in the history
Summary:
Inserting an entry in the block cache with 0 length key is a valid use case. Remove the assertion in ```LRUHandle::CalcTotalCharge```.
Pull Request resolved: facebook#6115

Differential Revision: D18769693

Pulled By: anand1976

fbshipit-source-id: 34cc159650300dda6d7273480640478f28392cda
  • Loading branch information
anand76 authored and facebook-github-bot committed Dec 2, 2019
1 parent 0ed3df2 commit 8812df4
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion cache/lru_cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ struct LRUHandle {
// Caclculate the memory usage by metadata
inline size_t CalcTotalCharge(
CacheMetadataChargePolicy metadata_charge_policy) {
assert(key_length);
size_t meta_charge = 0;
if (metadata_charge_policy == kFullChargeCacheMetadata) {
#ifdef ROCKSDB_MALLOC_USABLE_SIZE
Expand Down

0 comments on commit 8812df4

Please sign in to comment.