From 16fa6fd2a6bd0d22c0d2bc9f0f3bf2a296b3232d Mon Sep 17 00:00:00 2001 From: anand76 Date: Mon, 2 Dec 2019 14:58:22 -0800 Subject: [PATCH] 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 --- cache/lru_cache.h | 1 - 1 file changed, 1 deletion(-) diff --git a/cache/lru_cache.h b/cache/lru_cache.h index 6313c69db..1d9c8935c 100644 --- a/cache/lru_cache.h +++ b/cache/lru_cache.h @@ -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