Skip to content

Commit 1e63cc5

Browse files
jjuliamolinfacebook-github-bot
authored andcommitted
bug fix, convert KB to Bytes
Summary: Forgot to do a KB -> Bytes conversion, so disk limit was 1000x less than expected :) This is not in prod yet, the bug didn't affect prod and this fix won't either until we set this variable for glean.query.prod https://www.internalfb.com/code/configerator/[dc5e4b26185b5c8a2b17cb4f898e0872f7085882]/source/glean/server/glean.query.shadow.t3.cconf?lines=43-45 *note that the comment about 3.5TB is a bit leading, it's actually 4.2 TiB but our Shardmanager config is set to not use more than 85%* Reviewed By: malanka Differential Revision: D89123879
1 parent ac55002 commit 1e63cc5

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

glean/db/Glean/Database/Storage/RocksDB.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ data RocksDB = RocksDB
7070
, rocksCache :: Maybe Cache
7171
, rocksCacheIndexAndFilterBlocks :: Bool
7272
, rocksMaxDiskSize :: Maybe Int
73-
-- ^ virtual limit to report capped disk capacities. The limit is
73+
-- ^ virtual limit (bytes) to report capped disk capacities. The limit is
7474
-- not enforced. It's up to each io usage to check diskspace before writing.
7575
-- We're using this to avoid serving too many dbs on query servers,
7676
-- and smarter sharding.
@@ -82,14 +82,14 @@ newStorage root ServerConfig.Config{..} = do
8282
then
8383
Just <$> newCache (fromIntegral config_db_rocksdb_cache_mb * 1024 * 1024)
8484
else return Nothing
85-
mem_capacity <- totalMemCapacity
85+
mem_capacity <- totalMemCapacityKB
8686
return RocksDB
8787
{ rocksRoot = root
8888
, rocksCache = cache
8989
, rocksCacheIndexAndFilterBlocks =
9090
config_db_rocksdb_cache_index_and_filter_blocks
9191
, rocksMaxDiskSize = case mem_capacity of
92-
Just mem -> (* mem) . fromIntegral <$>
92+
Just mem -> (* (mem * 1024)) . fromIntegral <$>
9393
config_db_rocksdb_disk_mem_capacity_ratio_limit
9494
Nothing -> Nothing
9595
}

glean/util/Glean/Impl/MemoryReader.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
-}
88

99
module Glean.Impl.MemoryReader
10-
(totalMemCapacity
10+
(totalMemCapacityKB
1111
) where
1212

1313
-- template for open source build
1414
-- not implemented yet
15-
totalMemCapacity :: IO (Maybe Int)
16-
totalMemCapacity = return Nothing
15+
totalMemCapacityKB :: IO (Maybe Int)
16+
totalMemCapacityKB = return Nothing

0 commit comments

Comments
 (0)