Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-13161

Pass cache_size into __cache_config_abs_to_pct as an argument

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Configuration
    • Storage Engines
    • 3
    • StorEng - Defined Pipeline

      __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:
            backlog-server-storage-engines [DO NOT USE] Backlog - Storage Engines Team
            Reporter:
            andrew.morton@mongodb.com Andrew Morton
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: