Class LeaderChangedException

All Implemented Interfaces:
Serializable

public final class LeaderChangedException extends LoomException
Thrown when a write request's pending status becomes uncertain due to leadership change.

This exception is raised when a node steps down from leader during the commit phase. The entry may or may not be committed on the new leader, implementing at-least-once semantics. Clients should retry the request on a new leader.

Semantics: - The entry was accepted by THIS leader and added to the log - The entry may be committed on a new leader - The write should be retried on the new leader

This is different from NotLeaderException, which means this node is not the leader, so the client should retry elsewhere.

See Also:
  • Constructor Details

    • LeaderChangedException

      public LeaderChangedException(@Nullable String newLeaderId)
      Creates a new LeaderChangedException.
      Parameters:
      newLeaderId - the ID of the new leader (may be null if unknown)