Class OutdatedTopologyException

  • All Implemented Interfaces:
    Serializable

    public class OutdatedTopologyException
    extends CacheException
    An exception signalling that a command should be retried because a newer topology was seen during execution.

    Most of the time, read commands can be retried in the same topology, so they use a delta of 0, see RETRY_SAME_TOPOLOGY. Write commands cannot be retried in the same topology, so they always use a delta of 1 (or more).

    This exception can be thrown very often when node is joining or leaving, so it has not stack trace information, and using the constants is preferred.

    Since:
    6.0
    Author:
    Dan Berindei
    See Also:
    Serialized Form
    • Field Detail

      • topologyIdDelta

        public final int topologyIdDelta
      • RETRY_NEXT_TOPOLOGY

        public static final OutdatedTopologyException RETRY_NEXT_TOPOLOGY
        A cached instance that requests the command's topology id + 1.
      • RETRY_SAME_TOPOLOGY

        public static final OutdatedTopologyException RETRY_SAME_TOPOLOGY
        A cached instance, used for read commands that need to be retried in the same topology.

        This happens because we read from backup owners when the primary owners no longer have the entry, so we only retry when all of the owners reply with an UnsureResponse. Topologies T and T+1 always have at least one read owner in common, so receiving UnsureResponse from all the owners means either one owner had topology T+2 and by now we have at least T+1, or one owner had topology T-1 and another had T+1, and by now all should have at least T.

    • Constructor Detail

      • OutdatedTopologyException

        @Deprecated
        public OutdatedTopologyException​(String msg)
        Deprecated.
        Since 10.0, please use the constants
        Request the next topology (delta = 1) and use a custom message.
      • OutdatedTopologyException

        @Deprecated
        public OutdatedTopologyException​(int topologyIdDelta)
        Deprecated.
        Since 10.0, the explicit topology is ignored and the delta is set to 1
        Request retrying the command in explicitly set topology (or later one).