{"record":{"id":"a25a5cd3f2dd602f","repo":"microsoft/FASTER","slug":"warning-ignoring-invalid-read-cache-field-s","errorCode":null,"errorMessage":"warning: ignoring invalid *read-cache* field '%s'\n","messagePattern":"warning: ignoring invalid \\*read-cache\\* field '(.+?)'\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cc/src/core/config.h","lineNumber":184,"sourceCode":"template<>\nReadCacheConfig PopulateReadCacheConfig<false>(const toml::value& top_table) {\n  ReadCacheConfig rc_config{ .enabled = false };\n  if (top_table.contains(\"read_cache\")) {\n    const auto rc_table = toml::find(top_table, \"read_cache\");\n    rc_config.enabled = toml::find_or<bool>(rc_table, \"enabled\", rc_config.enabled);\n    rc_config.mem_size = rc_table.contains(\"in_mem_size_mb\") ?\n                            toml::find<uint64_t>(rc_table, \"in_mem_size_mb\") * (1 << 20) : rc_config.mem_size;\n\n    // toml11 does not parse ints if 'double' type is specified; the following implements the intended behavior\n    double mutable_fraction = toml::find_or<int>(rc_table, \"mutable_fraction\", -1); // -1 \"means\" not found with int type\n    rc_config.mutable_fraction = (mutable_fraction < 0) ? toml::find_or<double>(rc_table, \"mutable_fraction\", rc_config.mutable_fraction) : mutable_fraction;\n\n    rc_config.pre_allocate = toml::find_or(rc_table, \"pre_allocate\", rc_config.pre_allocate);\n\n    const std::vector<std::string> valid_read_cache_fields = { \"enabled\", \"in_mem_size_mb\", \"mutable_fraction\", \"pre_allocate\" };\n    for (auto& it : toml::get<toml::table>(rc_table)) {\n      if (std::find(valid_read_cache_fields.begin(), valid_read_cache_fields.end(), it.first) == valid_read_cache_fields.end()) {\n        fprintf(stderr, \"warning: ignoring invalid *read-cache* field '%s'\\n\", it.first.c_str());\n      }\n    }\n  }\n  return rc_config;\n}\n\n#endif\n\n// FasterKv Store config\ntemplate<class H>\nstruct FasterKvConfig{\n  typedef H hash_index_t;\n  typedef typename H::Config IndexConfig;\n\n  constexpr static bool IsColdStore = !H::IsSync();\n\n  IndexConfig index_config;\n  HlogConfig hlog_config;","sourceCodeStart":166,"sourceCodeEnd":202,"githubUrl":"https://github.com/microsoft/FASTER/blob/321d872eabda6a0345c8bd76419f89723ed864ae/cc/src/core/config.h#L166-L202","documentation":"When parsing the [read-cache] TOML section, PopulateReadCacheConfig checks every key against a whitelist (enabled, in_mem_size_mb, mutable_fraction, pre_allocate). Any other key is ignored with this stderr warning, so the intended read-cache setting is silently dropped.","triggerScenarios":"Calling F2Kv::FromConfigString with a read-cache table containing an unrecognized key, e.g. a misspelled 'in_mem_size_mb' or a field belonging to a different FASTER version.","commonSituations":"Config files copied between FASTER versions where read-cache options changed, typos in TOML keys, placing index-only fields like table_size under read_cache.","solutions":["Use only these keys in [read-cache]: enabled, in_mem_size_mb, mutable_fraction, pre_allocate","Correct or delete the offending key","Diff your config against the version's PopulateReadCacheConfig whitelist"],"exampleFix":"// before\n[read-cache]\nInMemSizeMB = 1024\n// after\n[read-cache]\nin_mem_size_mb = 1024","handlingStrategy":"validation","validationCode":"static const std::set<std::string> valid = {\"enabled\",\"in_mem_size_mb\",\"mutable_fraction\",\"pre_allocate\"};\nfor (const auto& [k, v] : readCacheTable)\n  if (!valid.count(k)) throw std::invalid_argument(\"invalid read-cache field: \" + k);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate read-cache keys before calling FromConfigString","Watch stderr during first run with any new config","Keep section-specific fields in their own tables"],"tags":["config","toml","validation","read-cache"],"backgroundTag":"invalid-config-value","analyzedSha":"321d872eabda6a0345c8bd76419f89723ed864ae","analyzedAt":"2026-09-15T22:18:00.693Z","contentChangedAt":"2026-09-15T22:18:00.693Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}