Remove key length assertion LRUHandle::CalcTotalCharge (#6115)

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: https://github.com/facebook/rocksdb/pull/6115

Differential Revision: D18769693

Pulled By: anand1976

fbshipit-source-id: 34cc159650300dda6d7273480640478f28392cda
main
anand76 5 years ago committed by Facebook Github Bot
parent 048472f620
commit 16fa6fd2a6
  1. 1
      cache/lru_cache.h

1
cache/lru_cache.h vendored

@ -133,7 +133,6 @@ struct LRUHandle {
// Caclculate the memory usage by metadata // Caclculate the memory usage by metadata
inline size_t CalcTotalCharge( inline size_t CalcTotalCharge(
CacheMetadataChargePolicy metadata_charge_policy) { CacheMetadataChargePolicy metadata_charge_policy) {
assert(key_length);
size_t meta_charge = 0; size_t meta_charge = 0;
if (metadata_charge_policy == kFullChargeCacheMetadata) { if (metadata_charge_policy == kFullChargeCacheMetadata) {
#ifdef ROCKSDB_MALLOC_USABLE_SIZE #ifdef ROCKSDB_MALLOC_USABLE_SIZE

Loading…
Cancel
Save