Uploaded image for project: 'Red Hat Data Grid'
  1. Red Hat Data Grid
  2. JDG-7055

Size based eviction documentation does not detail storage requirements

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Major Major
    • None
    • None
    • Core, Documentation
    • None
    • False
    • None
    • False

      It's not possible to configure the max-size eviction policy with the default memory storage type HEAP, attempts to do so result in the following exception:

      org.infinispan.commons.CacheConfigurationException: ISPN000504: Size (bytes) based eviction needs either off-heap or a binary compatible storage configured in the cache encoding
          at org.infinispan.configuration.cache.MemoryConfigurationBuilder.checkBinaryRequirement(MemoryConfigurationBuilder.java:271)
          at org.infinispan.configuration.cache.MemoryConfigurationBuilder.validate(MemoryConfigurationBuilder.java:308)
          at org.infinispan.configuration.cache.ConfigurationBuilder.validate(ConfigurationBuilder.java:198)
          at org.infinispan.configuration.cache.ConfigurationBuilder.build(ConfigurationBuilder.java:254)
          at org.infinispan.configuration.cache.ConfigurationBuilder.build(ConfigurationBuilder.java:244)
          at org.infinispan.configuration.parsing.ConfigurationBuilderHolder.resolveConfiguration(ConfigurationBuilderHolder.java:178)
          at org.infinispan.configuration.parsing.ConfigurationBuilderHolder.resolveConfigurations(ConfigurationBuilderHolder.java:161)
          at org.infinispan.configuration.parsing.ParserRegistry.parse(ParserRegistry.java:183)
          at org.infinispan.configuration.parsing.ParserRegistry.parse(ParserRegistry.java:175)
          at org.infinispan.server.Server.parseConfiguration(Server.java:323)
          at org.infinispan.server.Server.<init>(Server.java:235)
          at org.infinispan.server.Bootstrap.runInternal(Bootstrap.java:171)
          at org.infinispan.server.tool.Main.run(Main.java:98)
          at org.infinispan.server.Bootstrap.main(Bootstrap.java:56)
          ... 6 more 
      

      Currently the eviction documentation does not make it clear that OFF_HEAP storage is required in order to use the max-size eviction policy. Furthermore, the example max-size configurations are invalid as they do not explicitly configure the storage type to be OFF_HEAP.

      The following:

      distributedCache: 
        encoding: 
          mediaType: "application/x-protostream"
        memory: 
          maxSize: "1.5GB"
          whenFull: "REMOVE"
      

      Should become:

      distributedCache: 
        encoding: 
          mediaType: "application/x-protostream"
        memory: 
          storage: "OFF_HEAP"
          maxSize: "1.5GB"
          whenFull: "REMOVE"
      

              rhn-support-cacholon Chinyere Acholonu
              remerson@redhat.com Ryan Emerson
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: