0

I'd like to enable versioning for a replicated cache in a locally-running Infinispan server (8.2.4 final, two Infinispan servers form a cluster).

This is documented in the user guide.

Quote:

10.2.5. Configuration

By default versioning will be disabled.

and the user guide contains the following snippet:

<versioning scheme="SIMPLE|NONE" />

I am using locally-running Infinispan servers, the configuration is in clustered.xml.

A fragment thereof:

    <subsystem xmlns="urn:infinispan:server:core:8.2" default-cache-container="clustered">
        <cache-container name="clustered" default-cache="default" statistics="true">
            [...]
            <replicated-cache name="demoCache" mode="ASYNC" >
                <versioning scheme="SIMPLE"/>
            </replicated-cache>

So when I add the versioning element, starting fails with

Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[186,6]

Message: WFLYCTL0198: Unexpected element '{urn:infinispan:server:core:8.2}versioning' encountered

The XML element versioning indeed exists in urn:infinispan:config:8.2, but not in urn:infinispan:server:core:8.2 (which is used in clustered.xml).

urn:infinispan:config:8.2 is defined in infinispan-server-8.2.4.Final/docs/schema/infinispan-config-8.2.xsd.

urn:infinispan:server:core:8.2 is defined in infinispan-server-8.2.4.Final/docs/schema/jboss-infinispan-core_8_2.xsd

How can I enable (cluster aware) versioning when running Infinispan as a separate server?

Community
  • 1
  • 1
Beryllium
  • 12,808
  • 10
  • 56
  • 86

1 Answers1

1

Versioning does not make sense when using Infinispan remotely since versioning is purely used to detect write skew situations with repeteable read transactions, and that functionality is not really available to users in server mode.

Galder Zamarreño
  • 5,027
  • 2
  • 26
  • 34
  • I've logged [ISPN-7202](https://issues.jboss.org/browse/ISPN-7202) so that in the future the server logs a warning rather than throwing an error in this case. – Galder Zamarreño Nov 15 '16 at 12:21
  • Actually the error message is fine. I have realized that I am reading the Infinispan documentation under the assumption that all/most of it is applicable for Hotrod as well. So if it does not really make sense to use versioning through Hotrod, then please don't offer `replaceWithVersion()`, `getVersioned()`, `removeWithVersion()` etc. (or throw an exception - I think that's already the case with `values()`) – Beryllium Nov 15 '16 at 14:04
  • That's a different "versioning". When using Hot Rod, you actually can use the methods you listed but they don't refer to transactions. Hot Rod users can benefit from explicit entry versions (I use this quite a lot and it's great!) – Sanne Nov 19 '16 at 22:48