FEAT: dynamic range cache, undo set simplification #378

pbalcer opened this Issue Dec 22, 2016 · 1 comment


None yet
1 participant

pbalcer commented Dec 22, 2016

Dynamic range cache, undo set simplification


Currently the undo log that contains data snapshots is composed of two vectors: one contains cache for small (<= 32 bytes) data, and the second one contains allocations of snapshots of everything bigger. This mechanism was introduced to reduce the number of allocations performed during a transaction. The problem with this solution is that it introduces additional complexity and benefits only small percentage of workloads.


The proposed change is to unify the behavior of undo log sets and have a single vector that would contain both the caches and whole objects. The cache size would be runtime adjustable and all of the snapshots would be checked against a 'cache-able' threshold which would be expressed as a percentage of the cache size. That value would also be configurable. The cache entries would have dynamically adjustable sizes and would be placed linearly in the allocated cache memory block. Additionally, an option to retain the transaction caches would be present.

API Changes

Three new ctl entry points would be introduced:
"tx.snapshot_cache.size", "tx.snapshot_cache.threshold_pct" and "tx.snapshot_cache.retain"

The default values are TBD.

Implementation details

To achieve the goal of streamlining the set undo log code, this change would have to again break backward compatibility because the undo log layout would change.

@pbalcer pbalcer added this to the 1.3 milestone Dec 22, 2016

@pbalcer pbalcer self-assigned this Dec 22, 2016

@pbalcer pbalcer modified the milestones: 1.4, 1.3 Dec 22, 2016

@pbalcer pbalcer referenced this issue in pmem/pmdk Jan 31, 2017


implement dynamic range cache #1628

@pbalcer pbalcer closed this Feb 7, 2017


This comment has been minimized.

Show comment
Hide comment

pbalcer commented Mar 29, 2017


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment