-
Type: Improvement
-
Resolution: Unresolved
-
Priority: 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.