microsoft/FASTER · warning

warning: ignoring invalid *read-cache* field

Error message

warning: ignoring invalid *read-cache* field '%s'

What it means

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.

Solutions

  1. Use only these keys in [read-cache]: enabled, in_mem_size_mb, mutable_fraction, pre_allocate
  2. Correct or delete the offending key
  3. Diff your config against the version's PopulateReadCacheConfig whitelist

Example fix

// before
[read-cache]
InMemSizeMB = 1024
// after
[read-cache]
in_mem_size_mb = 1024
Defensive patterns

Strategy: validation

Validate before calling

static const std::set<std::string> valid = {"enabled","in_mem_size_mb","mutable_fraction","pre_allocate"};
for (const auto& [k, v] : readCacheTable)
  if (!valid.count(k)) throw std::invalid_argument("invalid read-cache field: " + k);

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of microsoft/FASTER@321d872eab (2026-09-15). Data as JSON: /api/errors/a25a5cd3f2dd602f. Report an issue: GitHub.

Appendix: source

Thrown at cc/src/core/config.h:184

template<>
ReadCacheConfig PopulateReadCacheConfig<false>(const toml::value& top_table) {
  ReadCacheConfig rc_config{ .enabled = false };
  if (top_table.contains("read_cache")) {
    const auto rc_table = toml::find(top_table, "read_cache");
    rc_config.enabled = toml::find_or<bool>(rc_table, "enabled", rc_config.enabled);
    rc_config.mem_size = rc_table.contains("in_mem_size_mb") ?
                            toml::find<uint64_t>(rc_table, "in_mem_size_mb") * (1 << 20) : rc_config.mem_size;

    // toml11 does not parse ints if 'double' type is specified; the following implements the intended behavior
    double mutable_fraction = toml::find_or<int>(rc_table, "mutable_fraction", -1); // -1 "means" not found with int type
    rc_config.mutable_fraction = (mutable_fraction < 0) ? toml::find_or<double>(rc_table, "mutable_fraction", rc_config.mutable_fraction) : mutable_fraction;

    rc_config.pre_allocate = toml::find_or(rc_table, "pre_allocate", rc_config.pre_allocate);

    const std::vector<std::string> valid_read_cache_fields = { "enabled", "in_mem_size_mb", "mutable_fraction", "pre_allocate" };
    for (auto& it : toml::get<toml::table>(rc_table)) {
      if (std::find(valid_read_cache_fields.begin(), valid_read_cache_fields.end(), it.first) == valid_read_cache_fields.end()) {
        fprintf(stderr, "warning: ignoring invalid *read-cache* field '%s'\n", it.first.c_str());
      }
    }
  }
  return rc_config;
}

#endif

// FasterKv Store config
template<class H>
struct FasterKvConfig{
  typedef H hash_index_t;
  typedef typename H::Config IndexConfig;

  constexpr static bool IsColdStore = !H::IsSync();

  IndexConfig index_config;
  HlogConfig hlog_config;

View on GitHub (pinned to 321d872eab)