Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-3477

Rework offheap storage

    XMLWordPrintableJSON

Details

    • Task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.0
    • cache

    Description

      Current (Ignite 1.x) implementation of cache storage relies on a tiered approach where cache entry can be located in one of the three storage areas: on-heap, off-heap memory and swap. It leads to the following disadvantages:

      • Entry constantly moves from one storage area to another which leads to a complex code (for example, swap/unswap listeners for queries and rebalancing)
      • It is not possible to set per-cache memory limit
      • Off-heap indexes require on-heap row cache. If this cache is small, performance becomes very poor
      • Continuous put/remove operations with OFFHEAP_TIERED mode lead to uncontrollable memory fragmentation

      We can reapproach the cache storage and base it on a concept of page memory. We will allocate several memory pools of pages of fixed size and assign each cache to one of the memory pools. All storage data structures should operate on memory pages, the main storage will be always off-heap with an optional on-heap cache.

      This gives us the following benefits:

      • Flexible and precise per-cache memory limit
      • Transparent swap: we can allocate page memory over a memory-mapped file and OS will take care of swapping
      • Getting rid of on-heap cache for off-heap SQL indexes
      • Ability to take a cluster-wide data snapshot

      I suggest the following API for memory policy configuration:

      class MemoryPolicy {
          boolean default; // Require at least one memory policy to be default.
          private String name;
          private long size;
          private String tmpFsPath; // If memory-mapped file should be used.
      }
      
      class CacheConfiguration {
      ....
          private String memoryPolicyName;
      ....
      }
      

      Attachments

        Issue Links

          Activity

            People

              agoncharuk Alexey Goncharuk
              agoncharuk Alexey Goncharuk
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 336h
                  336h
                  Remaining:
                  Remaining Estimate - Not Specified
                  Not Specified
                  Logged:
                  Time Spent - 32h Time Not Required
                  32h