Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-14279

"Divide by 0"-Exception on Cache.getStats()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 14.0.3.Final, 15.0.0.Final
    • 14.0.1.Final
    • None
    • None
    • Hide

      Config is done programmatically and set to the following:
      Config for CacheManager:

       

      configurationBuilderHolder.getGlobalConfigurationBuilder()
                  .clusteredDefault()
                      .cacheManagerName("CacheManager")
                  .cacheContainer()
                      .statistics(true)
                  .globalState()
                      .configurationStorage(ConfigurationStorage.OVERLAY)
                      .persistentLocation(cacheDir)
                  .transport()
                      .clusterName(clusterName)
                      .addProperty("configurationFile", "jgroups.xml")
                      .nodeName(hostName + ":" + httpPort)
                  .defaultCacheName("DEFAULT_CACHE")
                  .addModule(ClusteredLockManagerConfigurationBuilder.class)
                      .numOwner(2)
                      .reliability(Reliability.AVAILABLE);

       

      Config for Default-Cache:

      configurationBuilderHolder.newConfigurationBuilder("DEFAULT_CACHE")
                  .encoding()
                      .mediaType("application/x-protostream")
                  .memory()
                      .whenFull(EvictionStrategy.NONE)
                      .maxCount(-1)
                  .expiration()
                      .lifespan(-1)
                      .disableReaper()
                  .statistics()
                      .enable()
                  .clustering()
                      .cacheMode(CacheMode.REPL_SYNC)
                      .remoteTimeout(2, TimeUnit.MINUTES)
                  .stateTransfer()
                      .awaitInitialTransfer(false)
                      .fetchInMemoryState(true)
                      .timeout(10, TimeUnit.MINUTES)
                      .chunkSize(1024)
                  .transaction()
                      .lockingMode(LockingMode.PESSIMISTIC)
                      .autoCommit(true)                
                      .completedTxTimeout(60000)
                      .transactionMode(TransactionMode.TRANSACTIONAL)
                      .useSynchronization(false)
                      .notifications(true)
                      .reaperWakeUpInterval(30000)
                      .cacheStopTimeout(30000)
                      .transactionManagerLookup(new GenericTransactionManagerLookup())
                      .recovery()
                          .disable()
                  .locking()
                      .isolationLevel(IsolationLevel.REPEATABLE_READ)
                      .lockAcquisitionTimeout(1, TimeUnit.MINUTES); 

      Config for concrete Cache, inherited partially by default cache:

      ConfigurationChildBuilder cb = ((ConfigurationChildBuilder) new ConfigurationBuilder()
                      .read(defaultConfig)
                      .persistence()
                          .passivation(false)
                          .addSingleFileStore()
                          .location(cacheDir)
                          .segmented(false)
                          .shared(false)
                          .preload(true)
                          .async()
                              .enabled(true));
              
                  cb = cb.memory()
                          .whenFull(EvictionStrategy.REMOVE)
                          .maxCount(evictionSize);
                          
                  cb = cb.indexing()
                          .enable()
                          .storage(IndexStorage.LOCAL_HEAP)
                          .addKeyTransformer(LocalDate.class, LocalDateTransformer.class)
                          .addIndexedEntity(IndexedClass); 

      Now when a cache is created and already has a SingleFileStore-file stored at the storage location, the exception occurs when I do the following steps:

      1.) Create an instance of the default cache manager named "manager"
      2.) Define the configuration for a cache with the manager, using the default and concrete config shown above.
      3.) Starting the cache using manager.getCache(cacheName, true).
      4.) Get the AdvancedCache through cache.getAdvancedCache().
      5.) Get the stats using AdvancedCache.getStats()

      On the final step the exception occurs (if cache-size is large enough and there is no big delay between the cache's start and the getStats()).

       

      Show
      Config is done programmatically and set to the following: Config for CacheManager:   configurationBuilderHolder.getGlobalConfigurationBuilder()             .clusteredDefault()                 .cacheManagerName( "CacheManager" )             .cacheContainer()                 .statistics( true )             .globalState()                 .configurationStorage(ConfigurationStorage.OVERLAY)                 .persistentLocation(cacheDir)             .transport()                 .clusterName(clusterName)                 .addProperty( "configurationFile" , "jgroups.xml" )                 .nodeName(hostName + ":" + httpPort)             .defaultCacheName( "DEFAULT_CACHE" )             .addModule(ClusteredLockManagerConfigurationBuilder.class)                 .numOwner(2)                 .reliability(Reliability.AVAILABLE);   Config for Default-Cache: configurationBuilderHolder.newConfigurationBuilder( "DEFAULT_CACHE" )             .encoding()                 .mediaType( "application/x-protostream" )             .memory()                 .whenFull(EvictionStrategy.NONE)                 .maxCount(-1)             .expiration()                 .lifespan(-1)                 .disableReaper()             .statistics()                 .enable()             .clustering()                 .cacheMode(CacheMode.REPL_SYNC)                 .remoteTimeout(2, TimeUnit.MINUTES)             .stateTransfer()                 .awaitInitialTransfer( false )                 .fetchInMemoryState( true )                 .timeout(10, TimeUnit.MINUTES)                 .chunkSize(1024)             .transaction()                 .lockingMode(LockingMode.PESSIMISTIC)                 .autoCommit( true )                                 .completedTxTimeout(60000)                 .transactionMode(TransactionMode.TRANSACTIONAL)                 .useSynchronization( false )                 .notifications( true )                 .reaperWakeUpInterval(30000)                 .cacheStopTimeout(30000)                 .transactionManagerLookup( new GenericTransactionManagerLookup())                 .recovery()                     .disable()             .locking()                 .isolationLevel(IsolationLevel.REPEATABLE_READ)                 .lockAcquisitionTimeout(1, TimeUnit.MINUTES); Config for concrete Cache, inherited partially by default cache: ConfigurationChildBuilder cb = ((ConfigurationChildBuilder) new ConfigurationBuilder()                 .read(defaultConfig)                 .persistence()                     .passivation( false )                     .addSingleFileStore()                     .location(cacheDir)                     .segmented( false )                     .shared( false )                     .preload( true )                     .async()                         .enabled( true ));                      cb = cb.memory()                     .whenFull(EvictionStrategy.REMOVE)                     .maxCount(evictionSize);                                  cb = cb.indexing()                     .enable()                     .storage(IndexStorage.LOCAL_HEAP)                     .addKeyTransformer(LocalDate.class, LocalDateTransformer.class)                     .addIndexedEntity(IndexedClass); Now when a cache is created and already has a SingleFileStore-file stored at the storage location, the exception occurs when I do the following steps: 1.) Create an instance of the default cache manager named "manager" 2.) Define the configuration for a cache with the manager, using the default and concrete config shown above. 3.) Starting the cache using manager.getCache(cacheName, true). 4.) Get the AdvancedCache through cache.getAdvancedCache(). 5.) Get the stats using AdvancedCache.getStats() On the final step the exception occurs (if cache-size is large enough and there is no big delay between the cache's start and the getStats()).  

      A "/ by 0"-Exception occurs when getting stats on joining of a node into a replicated, embedded cache (Version 14.0.1.Final).

      The method-call 

      cache.getStats()
      

      produces a "/ by 0"-ArithmeticException when it reaches the passage on line 932 in the class PersistenceManagerImpl:

      return size * segments.size() / storeSegments;

      This only happens after the initial start of the cache-cluster. (e. g. One node already running in the cluster).
       

              rh-ee-jbolina Jose Bolina
              prom3thean Thomas Meier (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: