Pass cache_size into __cache_config_abs_to_pct as an argument

XMLWordPrintableJSON

    • Storage Engines
    • StorEng - Defined Pipeline
    • 3

      __cache_config_abs_to_pct converts an absolute value to a percentage of cache_size, but it does so by reading off the connection structure with conn->cache_size.
      This can lead to a scenario like

      WT_RET(__wt_config_gets(session, cfg, "cache_size", &cval));
      conn->cache_size = (uint64_t)cval.val;
      
      ...
      
      cache->eviction_checkpoint_target = (double)cval.val;
      WT_RET(__cache_config_abs_to_pct(
            session, &(cache->eviction_checkpoint_target), "eviction checkpoint target", shared)); 

      where it's not immediately obvious that the eviction_checkpoint_target logic is dependent on the cache_size read above.

      We should instead convert `__cache_config_abs_to_pct` to a pure function that takes `cache_size` as an argument to make the dependency obvious.

              Assignee:
              [DO NOT USE] Backlog - Storage Engines Team
              Reporter:
              Andrew Morton
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: