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

Hotrod clients getWithMetadata doesn't work when locking isolation != NONE

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Minor
    • 6.0.0.Beta1, 6.0.0.Final
    • 5.3.0.Final, 6.0.0.Alpha4
    • None
    • None

    Description

      I have a cluster of 2 infinispan servers with this configuration:

      <subsystem xmlns="urn:infinispan:server:core:5.3">
          <cache-container name="default" default-cache="default" listener-executor="infinispan-listener">
              <transport stack="udp" executor="infinispan-transport" lock-timeout="240000"/>
              <distributed-cache name="default" start="EAGER" mode="SYNC" segments="1" owners="2" batching="false" l1-lifespan="0" remote-timeout="60000">
                  <locking isolation="REPEATABLE_READ"/>
              </distributed-cache>
          </cache-container>
      </subsystem>

      Running this code:

      remoteCache.put("k1", "v1", 10000000, TimeUnit.MICROSECONDS); // setting only lifespan
      MetadataValue<String> k1 = remoteCache.getWithMetadata("k1");
      assertTrue(k1.getValue().equals("v1"));
      // microseconds converted to seconds
      assertTrue(k1.getLifespan() == 10);
      assertTrue(k1.getMaxIdle() == -1);

      fails with:

      org.infinispan.client.hotrod.exceptions.HotRodClientException:Request for message id[5] returned server error (status=0x85): java.lang.ClassCastException: org.infinispan.container.entries.RepeatableReadEntry can
      not be cast to org.infinispan.container.entries.InternalCacheEntry
              at org.infinispan.client.hotrod.impl.protocol.Codec10.checkForErrorsInResponseStatus(Codec10.java:143)
              at org.infinispan.client.hotrod.impl.protocol.Codec10.readHeader(Codec10.java:99)
              at org.infinispan.client.hotrod.impl.operations.HotRodOperation.readHeaderAndValidate(HotRodOperation.java:56)
              at org.infinispan.client.hotrod.impl.operations.AbstractKeyOperation.sendKeyOperation(AbstractKeyOperation.java:52)
              at org.infinispan.client.hotrod.impl.operations.GetWithMetadataOperation.executeOperation(GetWithMetadataOperation.java:35)
              at org.infinispan.client.hotrod.impl.operations.GetWithMetadataOperation.executeOperation(GetWithMetadataOperation.java:23)
              at org.infinispan.client.hotrod.impl.operations.RetryOnFailureOperation.execute(RetryOnFailureOperation.java:46)
              at org.infinispan.client.hotrod.impl.RemoteCacheImpl.getWithMetadata(RemoteCacheImpl.java:145)

      Works with isolation="READ_COMMITED"/"NONE" or with no <locking> at all.

      Attachments

        Activity

          People

            rh-ee-galder Galder ZamarreƱo
            jmarkos Jakub Markos (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: