4 Replies Latest reply on Sep 19, 2013 11:56 AM by dan.berindei

    infinispan5.3 fetchInMemoryState=false,some data loss

    sixiaozi

      infinispan5.3.0 use distributed mode, and set fetchInMemoryState = false, when kill off a node, some data loss

      4 servers for the cluster


      my infinispan.xml file:

      <clustering mode="distribution">

                              <l1 enabled="false" />

                              <hash numOwners="2" numSegments="80">

                              </hash>

                              <sync replTimeout="15000" />

                              <stateTransfer chunkSize="2000" timeout="10000" fetchInMemoryState="false"/>

                      </clustering>

      Please help me, thanks!

        • 1. Re: infinispan5.3 fetchInMemoryState=false,some data loss
          dan.berindei

          Why do you need fetchInMemoryState = false?

           

          Unfortunately, the documentation of that configuration element is not complete/accurate, and it doesn't mention that it could lead to data loss, but it is the expected behaviour. I've created ISPN-3469 to track the documentation update.

          • 2. Re: infinispan5.3 fetchInMemoryState=false,some data loss
            sixiaozi

            fetchInMemoryState set false, the data will not move when a node leaves.

            I think ,some data should not be lost when fetchInMemoryState set false and numOwners="2", do you think?

            • 3. Re: infinispan5.3 fetchInMemoryState=false,some data loss
              dan.berindei

              The data is not really lost, the owner that survived still has the data. But when numOwners = 2, Infinispan will allocate another owner to hold that entry, and both owners are considered equal. If the new owner doesn't fetch the value from the surviving owner, it will consider that the entry is missing. We assume that you set fetchInMemoryState = false because you can easily recreate the entry from another source, so you won't mind some nodes seeing a missing entry.

               

              I guess it would be possible to write a custom ConsistentHashFactory that only allocates new owners for entries that have 0 owners, so that all the nodes would see the same value even with fetchInMemoryState = false. But I don't really see a use case for that...

              • 4. Re: infinispan5.3 fetchInMemoryState=false,some data loss
                dan.berindei

                I realized that there may be another way to get what you want: use JMX to connect to the LocalTopologyManager MBean and set the rebalancingEnabled attribute to false. There's no way to do it via configuration, but you only have to do it when you start the first node in the cluster.