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

Cassandra Cache Store is read-only by default

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Major Major
    • None
    • 5.2.6.Final, 6.0.0.Alpha4
    • Loaders and Stores
    • None

      It is impossible to store any data in the Cassandra cache store, because it is created as read-only, even when specifying ignoreModifications = false. See the attached test case:

      [INFO ] ISPN000078: Starting JGroups Channel (org.infinispan.remoting.transport.jgroups.JGroupsTransport)
      [INFO ] ISPN000088: Unable to use any JGroups configuration mechanisms provided in properties {}. Using default JGroups configuration! (org.infinispan.remoting.transport.jgroups.JGroupsTransport)
      [INFO ] ISPN000094: Received new cluster view: [GNELA182-53637|0] [GNELA182-53637] (org.infinispan.remoting.transport.jgroups.JGroupsTransport)
      [INFO ] ISPN000079: Cache local address is GNELA182-53637, physical addresses are [fe80:0:0:0:64f5:4fad:cd2e:b5cf:51350] (org.infinispan.remoting.transport.jgroups.JGroupsTransport)
      [INFO ] ISPN000128: Infinispan version: Infinispan 'Delirium' 5.2.6.Final (org.infinispan.factories.GlobalComponentRegistry)
      [DEBUG] automatically create keyspace (org.infinispan.loaders.cassandra.CassandraCacheStore)
      [INFO ] ConnectionPool initialized. (net.dataforte.cassandra.pool.ConnectionPool)
      [DEBUG] cleaning up expired entries... (org.infinispan.loaders.cassandra.CassandraCacheStore)
      [TRACE] purgeInternal (org.infinispan.loaders.cassandra.CassandraCacheStore)
      [INFO ] ConnectionPool initialized. (net.dataforte.cassandra.pool.ConnectionPool)
      [DEBUG] started (org.infinispan.loaders.cassandra.CassandraCacheStore)
      [TRACE] Ignoring clear invocation (org.infinispan.loaders.decorators.ReadOnlyStore)
      [INFO ] ISPN000031: MBeans were successfully registered to the platform MBean server. (org.infinispan.jmx.CacheJmxRegistration)
      [INFO ] creating test1 (com.agfa.aca.PassivationTest)
      [DEBUG] Key 'entry_test1' not found (org.infinispan.loaders.cassandra.CassandraCacheStore)
      [TRACE] Ignoring removal of key (org.infinispan.loaders.decorators.ReadOnlyStore)
      [INFO ] created test1 (com.agfa.aca.PassivationTest)
      [INFO ] creating test2 (com.agfa.aca.PassivationTest)
      [DEBUG] Key 'entry_test2' not found (org.infinispan.loaders.cassandra.CassandraCacheStore)
      [INFO ] passivating test1 (com.agfa.aca.PassivationTest)
      [TRACE] Ignoring store invocation (org.infinispan.loaders.decorators.ReadOnlyStore)
      [INFO ] passivated test1 (com.agfa.aca.PassivationTest)
      [TRACE] Ignoring removal of key (org.infinispan.loaders.decorators.ReadOnlyStore)
      [INFO ] created test2 (com.agfa.aca.PassivationTest)
      [DEBUG] Key 'entry_test1' not found (org.infinispan.loaders.cassandra.CassandraCacheStore)

      I tracked this bug down to the create method in CassandraCacheStoreConfigurationBuilder

         @Override
         public CassandraCacheStoreConfiguration create() {
            List<CassandraServerConfiguration> remoteServers = new ArrayList<CassandraServerConfiguration>();
            for (CassandraServerConfigurationBuilder server : servers) {
               remoteServers.add(server.create());
            }
            return new CassandraCacheStoreConfiguration(autoCreateKeyspace, configurationPropertiesFile, entryColumnFamily,
                  expirationColumnFamily, framed, remoteServers, keyMapper, keySpace, password, sharedKeyspace, username,
                  readConsistencyLevel, writeConsistencyLevel, autoCreateKeyspace, sharedKeyspace, purgerThreads, framed,
                  autoCreateKeyspace, TypedProperties.toTypedProperties(properties), async.create(), singletonStore.create());
         }
      

      Note how autoCreateKeyspace is used in stead of purgeInternal and ignoreModifications, so if you explicitly set autoCreateKeyspace = false you can work around the issue.
      This is tested on 5.2.6, all versions from 5.2 on have the same error.

            Unassigned Unassigned
            gmels Giovanni Mels (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: