All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cluster.aeron-cluster-codecs.xml Maven / Gradle / Ivy

There is a newer version: 1.48.0
Show newest version
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<sbe:messageSchema xmlns:sbe="http://fixprotocol.io/2016/sbe"
                   package="io.aeron.cluster.codecs"
                   id="111"
                   version="12"
                   semanticVersion="5.4"
                   description="Message Codecs for communicating with, and within, an Aeron Cluster."
                   byteOrder="littleEndian">
    <types>
        <composite name="messageHeader" description="Message identifiers and length of message root.">
            <type name="blockLength"    primitiveType="uint16"/>
            <type name="templateId"     primitiveType="uint16"/>
            <type name="schemaId"       primitiveType="uint16"/>
            <type name="version"        primitiveType="uint16"/>
        </composite>
        <composite name="groupSizeEncoding" description="Repeating group dimensions.">
            <type name="blockLength"    primitiveType="uint16"/>
            <type name="numInGroup"     primitiveType="uint16"/>
        </composite>
        <composite name="varAsciiEncoding" description="Variable length ASCII string header.">
            <type name="length"         primitiveType="uint32" maxValue="1073741824"/>
            <type name="varData"        primitiveType="uint8" length="0" characterEncoding="US-ASCII"/>
        </composite>
        <composite name="varDataEncoding" description="Variable length data blob header.">
            <type name="length"         primitiveType="uint32" maxValue="1073741824"/>
            <type name="varData"        primitiveType="uint8" length="0"/>
        </composite>
        <enum name="BooleanType" encodingType="int32" description="Language independent boolean type.">
            <validValue name="FALSE" description="Language independent boolean false.">0</validValue>
            <validValue name="TRUE" description="Language independent boolean true.">1</validValue>
        </enum>
        <enum name="EventCode" encodingType="int32" description="Type of event for a response.">
            <validValue name="OK" description="Operation was successful">0</validValue>
            <validValue name="ERROR" description="Error occurred during operation.">1</validValue>
            <validValue name="REDIRECT" description="Redirect to cluster leader.">2</validValue>
            <validValue name="AUTHENTICATION_REJECTED" description="Authentication credentials rejected.">3</validValue>
            <validValue name="CLOSED" description="Session has been closed.">4</validValue>
        </enum>
        <enum name="CloseReason" encodingType="int32" description="Reason why a session was closed.">
            <validValue name="CLIENT_ACTION" description="Client closed the session.">0</validValue>
            <validValue name="SERVICE_ACTION" description="Service closed the session.">1</validValue>
            <validValue name="TIMEOUT" description="Session timed out due to inactivity.">2</validValue>
        </enum>
        <enum name="ClusterAction" encodingType="int32" description="Action to be taken by cluster nodes.">
            <validValue name="SUSPEND" description="Suspend ingress to the cluster.">0</validValue>
            <validValue name="RESUME" description="Resume ingress to the cluster.">1</validValue>
            <validValue name="SNAPSHOT" description="Snapshot state in the cluster.">2</validValue>
        </enum>
        <enum name="SnapshotMark" encodingType="int32" description="Mark within a snapshot.">
            <validValue name="BEGIN" description="Begin marker for a snapshot.">0</validValue>
            <validValue name="SECTION" description="Section marker for a snapshot.">1</validValue>
            <validValue name="END" description="End marker for a snapshot.">2</validValue>
        </enum>
        <enum name="ChangeType" encodingType="int32" description="Type of Cluster Change Event.">
            <validValue name="JOIN" description="Join cluster as dynamic member.">0</validValue>
            <validValue name="QUIT" description="Quit cluster as dynamic member.">1</validValue>
        </enum>
        <enum name="ClusterTimeUnit" encodingType="int32" description="Type the time unit used for timestamps.">
            <validValue name="MILLIS" description="Time unit of milliseconds for timestamps.">0</validValue>
            <validValue name="MICROS" description="Time unit of microseconds for timestamps.">1</validValue>
            <validValue name="NANOS" description="Time unit of nanoseconds for timestamps.">2</validValue>
        </enum>
        <enum name="AdminRequestType" encodingType="int32" description="Admin command to execute in the cluster.">
            <validValue name="SNAPSHOT" description="Command to snapshot state in the cluster.">0</validValue>
        </enum>
        <enum name="AdminResponseCode" encodingType="int32" description="Response code for an admin command request.">
            <validValue name="OK" description="Command was submitted or executed successfully.">0</validValue>
            <validValue name="ERROR" description="An error occurred during admin operation.">1</validValue>
            <validValue name="UNAUTHORISED_ACCESS" description="Admin request was not authorised.">2</validValue>
        </enum>
        <type name="time_t"    primitiveType="int64" description="Epoch time since 1 Jan 1970 UTC."/>
        <type name="version_t" primitiveType="int32" description="Protocol or application suite version."
              presence="optional" nullValue="0" minValue="1" maxValue="16777215"/>
        <type name="capacity_t" primitiveType="int32" description="Capacity of a container."
              presence="optional" nullValue="0"/>
    </types>

<!--
    Cluster Session Protocol
    ========================

    Session Protocol:
        -> session-connect, *[session-message | session-keep-alive | admin-request], session-close
                          \
        <-                 +session-event, *[session-event | session-message | new-leader-event | admin-response]

    1. Session Connect
        - An attempt is made to establish a connection with the cluster via multicast or multi-destination-cast.
        - If successful, an OK session-event will be sent in the return path with the list of endpoint destinations
          for the cluster members. The leader will come first.
        - Followers can respond with a REDIRECT code and a list of member endpoint destinations in the
          detail that will have the leader first.
        - If a change of leader occurs mid-session then a new-leader-event will be sent from the new leader.

    2. Ingress/Egress Messages - Session Messages which make up application protocol.
        - Messages are sent to a clustered service with a SessionMessageHeader followed by an application payload.
        - The service may emit responses and events with a SessionMessageHeader followed by an application payload.
        - The application protocol is the user defined messages for interacting with the service being clustered.
        - Keep alive messages should be sent when insufficient ingress messages are sent to keep the session open.

    3. Session Close
        - A cluster session can be closed with a CloseSessionRequest.
        - If the session is not explicitly closed then it will close following a timeout when the connection goes away.

    Cluster Authentication Protocol
    ===============================

    Connect protocol can occur in multiple valid sequences

    1. Authenticated via Session Connect
        -> session-connect, ...
                          \
        <-                 *session-event (OK), ...

    2. Authenticated via Challenge Response
        -> session-connect           challenge-response, ...
                          \         /                  \
        <-                 challenge                    session-event (OK), ...

    3. Rejected via Session Connect
        -> session-connect
                          \
        <-                 *session-event (AUTHENTICATION_REJECTED)

    4. Rejected via Challenge Response
        -> session-connect           challenge-response
                          \         /                  \
        <-                 challenge                     session-event (AUTHENTICATION_REJECTED)
-->

    <sbe:message name="SessionMessageHeader"
                 id="1"
                 description="Header for application session messages between clients and cluster services.">
        <field name="leadershipTermId"         id="1" type="int64"/>
        <field name="clusterSessionId"         id="2" type="int64"/>
        <field name="timestamp"                id="3" type="time_t"/>
    </sbe:message>

    <sbe:message name="SessionEvent"
                 id="2"
                 description="Response to a connect request or async event, details will be empty if code is OK.">
        <field name="clusterSessionId"         id="1" type="int64"
               description="Session id for a multiplexed session over a shared connection, i.e. same Image."/>
        <field name="correlationId"            id="2" type="int64"
               description="Request correlation id with which this event is associated."/>
        <field name="leadershipTermId"         id="3" type="int64"
               description="Current leadership term identifier."/>
        <field name="leaderMemberId"           id="4" type="int32"
               description="Current leader of the cluster."/>
        <field name="code"                     id="5" type="EventCode"
               description="Code type of the response."/>
        <field name="version"                  id="6" type="version_t" presence="optional" sinceVersion="6"
               description="Protocol version for the server using semantic version form."/>
        <data  name="detail"                   id="7" type="varAsciiEncoding"
               description="Further detail such as an error message or list of cluster ingress endpoints."/>
    </sbe:message>

    <sbe:message name="SessionConnectRequest"
                 id="3"
                 description="Connect to the cluster and if successful then open a session.">
        <field name="correlationId"            id="1" type="int64"/>
        <field name="responseStreamId"         id="2" type="int32"/>
        <field name="version"                  id="3" type="version_t" presence="optional" sinceVersion="2"/>
        <data  name="responseChannel"          id="4" type="varAsciiEncoding"/>
        <data  name="encodedCredentials"       id="5" type="varDataEncoding"/>
    </sbe:message>

    <sbe:message name="SessionCloseRequest"
                 id="4"
                 description="Close an open cluster session.">
        <field name="leadershipTermId"         id="1" type="int64"/>
        <field name="clusterSessionId"         id="2" type="int64"/>
    </sbe:message>

    <sbe:message name="SessionKeepAlive"
                 id="5"
                 description="Keep a cluster session open by indicating the client is alive.">
        <field name="leadershipTermId"         id="1" type="int64"/>
        <field name="clusterSessionId"         id="2" type="int64"/>
    </sbe:message>

    <sbe:message name="NewLeaderEvent"
                 id="6"
                 description="Event to indicate a new leader has been elected for the cluster.">
        <field name="leadershipTermId"         id="1" type="int64"/>
        <field name="clusterSessionId"         id="2" type="int64"/>
        <field name="leaderMemberId"           id="3" type="int32"/>
        <data  name="ingressEndpoints"         id="4" type="varAsciiEncoding"/>
    </sbe:message>

    <sbe:message name="Challenge"
                 id="7"
                 description="Challenge the client to provide credentials.">
        <field name="correlationId"            id="1" type="int64"/>
        <field name="clusterSessionId"         id="2" type="int64"/>
        <data  name="encodedChallenge"         id="3" type="varDataEncoding"/>
    </sbe:message>

    <sbe:message name="ChallengeResponse"
                 id="8"
                 description="Response to a cluster challenge with credentials.">
        <field name="correlationId"            id="1" type="int64"/>
        <field name="clusterSessionId"         id="2" type="int64"/>
        <data  name="encodedCredentials"       id="3" type="varDataEncoding"/>
    </sbe:message>

<!-- Codecs for messages that get encoded into the log by the Consensus Module -->

    <sbe:message name="TimerEvent"
                 id="20"
                 description="Timer triggered event as the result of a deadline passing on a registered timer.">
        <field name="leadershipTermId"         id="1" type="int64"/>
        <field name="correlationId"            id="2" type="int64"/>
        <field name="timestamp"                id="3" type="time_t"/>
    </sbe:message>

    <sbe:message name="SessionOpenEvent"
                 id="21"
                 description="Event for the state machine to notify a session has been opened.">
        <field name="leadershipTermId"         id="1" type="int64"/>
        <field name="correlationId"            id="2" type="int64"/>
        <field name="clusterSessionId"         id="3" type="int64"/>
        <field name="timestamp"                id="4" type="time_t"/>
        <field name="responseStreamId"         id="6" type="int32"/>
        <data  name="responseChannel"          id="7" type="varAsciiEncoding"/>
        <data  name="encodedPrincipal"         id="8" type="varDataEncoding"/>
    </sbe:message>

    <sbe:message name="SessionCloseEvent"
                 id="22"
                 description="Event for the state machine to notify a session has been closed.">
        <field name="leadershipTermId"         id="1" type="int64"/>
        <field name="clusterSessionId"         id="2" type="int64"/>
        <field name="timestamp"                id="3" type="time_t"/>
        <field name="closeReason"              id="4" type="CloseReason"/>
    </sbe:message>

    <sbe:message name="ClusterActionRequest"
                 id="23"
                 description="Request an action be taken by the service.">
        <field name="leadershipTermId"         id="1" type="int64"/>
        <field name="logPosition"              id="2" type="int64"/>
        <field name="timestamp"                id="3" type="time_t"/>
        <field name="action"                   id="4" type="ClusterAction"/>
        <field name="flags"                    id="5" type="int32" sinceVersion="11" presence="optional"/>
    </sbe:message>

    <sbe:message name="NewLeadershipTermEvent"
                 id="24"
                 description="Event for the start of a new leadership term.">
        <field name="leadershipTermId"         id="1" type="int64"/>
        <field name="logPosition"              id="2" type="int64"/>
        <field name="timestamp"                id="3" type="time_t"/>
        <field name="termBaseLogPosition"      id="4" type="int64"/>
        <field name="leaderMemberId"           id="5" type="int32"/>
        <field name="logSessionId"             id="6" type="int32"/>
        <field name="timeUnit"                 id="7" type="ClusterTimeUnit" sinceVersion="4" presence="optional"/>
        <field name="appVersion"               id="8" type="version_t" sinceVersion="4" presence="optional"/>
    </sbe:message>

    <sbe:message name="MembershipChangeEvent"
                 id="25"
                 description="Event for the change of the cluster membership that affects the cluster size.">
        <field name="leadershipTermId"         id="1" type="int64"/>
        <field name="logPosition"              id="2" type="int64"/>
        <field name="timestamp"                id="3" type="time_t"/>
        <field name="leaderMemberId"           id="4" type="int32"/>
        <field name="clusterSize"              id="5" type="int32"/>
        <field name="changeType"               id="6" type="ChangeType"/>
        <field name="memberId"                 id="7" type="int32"/>
        <data  name="clusterMembers"           id="8" type="varAsciiEncoding"/>
    </sbe:message>

    <sbe:message name="AdminRequest"
                 id="26"
                 description="Request to execute an admin command in the cluster.">
        <field name="leadershipTermId"         id="1" type="int64"
               description="Current leadership term identifier."/>
        <field name="clusterSessionId"         id="2" type="int64"
               description="Session id of the cluster client which made the request."/>
        <field name="correlationId"            id="3" type="int64"
               description="Correlation id with which the response could be associated with."/>
        <field name="requestType"              id="4" type="AdminRequestType"
               description="Type of the request to be executed."/>
        <data name="payload"                   id="5" type="varDataEncoding"
              description="An optional request payload, can be empty."/>
    </sbe:message>

    <sbe:message name="AdminResponse"
                 id="27"
                 description="Response to the admin request.">
        <field name="clusterSessionId"         id="1" type="int64"
               description="Session id of the cluster client which made the request."/>
        <field name="correlationId"            id="2" type="int64"
               description="AdminRequest correlation id with which this response is associated."/>
        <field name="requestType"              id="3" type="AdminRequestType"
               description="A type of the admin request that was executed."/>
        <field name="responseCode"             id="4" type="AdminResponseCode"
               description="A response code describing the result."/>
        <data name="message"                   id="5" type="varAsciiEncoding"
              description="A response message (e.g. an error message)."/>
        <data name="payload"                   id="6" type="varDataEncoding"
              description="An optional response payload, can be empty."/>
    </sbe:message>

<!-- Messages for the control protocol between clustered services, or cluster tool, and the Consensus Module -->

    <sbe:message name="CloseSession"
                 id="30"
                 description="Service instructing that a session be closed.">
        <field name="clusterSessionId"         id="1" type="int64"/>
    </sbe:message>

    <sbe:message name="ScheduleTimer"
                 id="31"
                 description="Schedule a timer event to or reschedule for an unexpired correlation id.">
        <field name="correlationId"            id="1" type="int64"/>
        <field name="deadline"                 id="2" type="time_t"/>
    </sbe:message>

    <sbe:message name="CancelTimer"
                 id="32"
                 description="Cancel a scheduled timer event.">
        <field name="correlationId"            id="1" type="int64"/>
    </sbe:message>

    <sbe:message name="ServiceAck"
                 id="33"
                 description="Service acknowledging that it has reached a position or taken an action.">
        <field name="logPosition"              id="1" type="int64"/>
        <field name="timestamp"                id="2" type="time_t"/>
        <field name="ackId"                    id="3" type="int64"/>
        <field name="relevantId"               id="4" type="int64"/>
        <field name="serviceId"                id="5" type="int32"/>
    </sbe:message>

    <sbe:message name="ClusterMembersQuery"
                 id="34"
                 description="Request list of cluster members and passive followers to be sent.">
        <field name="correlationId"            id="1" type="int64"/>
        <field name="extended"                 id="2" type="BooleanType" sinceVersion="5" presence="optional"/>
    </sbe:message>

    <sbe:message name="RemoveMember"
                 id="35"
                 description="Remove a cluster member either as normal member or passive member."
                 deprecated="12">
        <field name="memberId"                 id="1" type="int32"/>
        <field name="isPassive"                id="2" type="BooleanType"/>
    </sbe:message>

    <sbe:message name="JoinLog"
                 id="40"
                 description="Consensus Module instructing a service to join a log.">
        <field name="logPosition"              id="1" type="int64"/>
        <field name="maxLogPosition"           id="2" type="int64"/>
        <field name="memberId"                 id="3" type="int32"/>
        <field name="logSessionId"             id="4" type="int32"/>
        <field name="logStreamId"              id="5" type="int32"/>
        <field name="isStartup"                id="6" type="BooleanType"/>
        <field name="role"                     id="7" type="int32"/>
        <data  name="logChannel"               id="8" type="varAsciiEncoding"/>
    </sbe:message>

    <sbe:message name="ClusterMembersResponse"
                 id="41"
                 description="Cluster Members for normal and passive followers.">
        <field name="correlationId"            id="1" type="int64"/>
        <field name="leaderMemberId"           id="2" type="int32"/>
        <data name="activeMembers"             id="3" type="varAsciiEncoding"/>
        <data name="passiveFollowers"          id="4" type="varAsciiEncoding"/>
    </sbe:message>

    <sbe:message name="ServiceTerminationPosition"
                 id="42"
                 description="Consensus Module instructing a service to terminate at a given position.">
        <field name="logPosition"              id="1" type="int64"/>
    </sbe:message>

    <sbe:message name="ClusterMembersExtendedResponse"
                 id="43"
                 description="Cluster Members status for active and passive members.">
        <field name="correlationId"            id="1" type="int64"/>
        <field name="currentTimeNs"            id="2" type="time_t"/>
        <field name="leaderMemberId"           id="3" type="int32"/>
        <field name="memberId"                 id="4" type="int32"/>
        <group name="activeMembers"            id="5" dimensionType="groupSizeEncoding"
               description="Members of the cluster which have voting rights.">
            <field name="leadershipTermId"     id="6" type="int64"/>
            <field name="logPosition"          id="7" type="int64"/>
            <field name="timeOfLastAppendNs"   id="8" type="time_t"/>
            <field name="memberId"             id="9" type="int32"/>
            <data name="ingressEndpoint"       id="10" type="varAsciiEncoding"/>
            <data name="consensusEndpoint"     id="11" type="varAsciiEncoding"/>
            <data name="logEndpoint"           id="12" type="varAsciiEncoding"/>
            <data name="catchupEndpoint"       id="13" type="varAsciiEncoding"/>
            <data name="archiveEndpoint"       id="14" type="varAsciiEncoding"/>
        </group>
        <group name="passiveMembers"           id="15" dimensionType="groupSizeEncoding"
               description="Members of the cluster which do not have voting rights but could become active members.">
            <field name="leadershipTermId"     id="16" type="int64"/>
            <field name="logPosition"          id="17" type="int64"/>
            <field name="timeOfLastAppendNs"   id="18" type="time_t"/>
            <field name="memberId"             id="19" type="int32"/>
            <data name="ingressEndpoint"       id="20" type="varAsciiEncoding"/>
            <data name="consensusEndpoint"     id="21" type="varAsciiEncoding"/>
            <data name="logEndpoint"           id="22" type="varAsciiEncoding"/>
            <data name="catchupEndpoint"       id="23" type="varAsciiEncoding"/>
            <data name="archiveEndpoint"       id="24" type="varAsciiEncoding"/>
        </group>
    </sbe:message>

    <sbe:message name="requestServiceAck"
                 id="108"
                 description="request an ack from all service container on the same node">
        <field name="logPosition" id="1" type="int64"/>
    </sbe:message>

<!--
    Cluster Consensus Protocol
    ==========================

    The leader replicates a log stream to all followers for its term as leader. Leadership term ids are monotonic.

    The followers persist the replicated log locally and send updates to the leader with the highest position they
    have persisted. The log position is an accumulation of the term positions over the leadership terms.
    Each leadership term starts with base log position for the accumulated term positions.

    The leader gathers the positions reached by the followers, plus its own locally persisted log, and publishes
    the highest position for a quorum of the member nodes including itself which can be committed to the state
    machines. If the quorum position does not progress within a timeout then the latest position will be
    re-transmitted as a heartbeat from the leader.

    Messages are only valid within the context of a leadership term and all updates are applied as monotonically
    increasing state.
-->

    <sbe:message name="CanvassPosition"
                 id="50"
                 description="Position a follower has appended to their local log when canvassing for leadership.">
        <field name="logLeadershipTermId"      id="1" type="int64"/>
        <field name="logPosition"              id="2" type="int64"/>
        <field name="leadershipTermId"         id="3" type="int64"/>
        <field name="followerMemberId"         id="4" type="int32"/>
        <field name="protocolVersion"          id="5" type="version_t" sinceVersion="9"/>
    </sbe:message>

    <sbe:message name="RequestVote"
                 id="51"
                 description="Request the vote from another member to become the cluster leader.">
        <field name="logLeadershipTermId"      id="1" type="int64"/>
        <field name="logPosition"              id="2" type="int64"/>
        <field name="candidateTermId"          id="3" type="int64"/>
        <field name="candidateMemberId"        id="4" type="int32"/>
        <field name="protocolVersion"          id="5" type="version_t" sinceVersion="9"/>
    </sbe:message>

    <sbe:message name="Vote"
                 id="52"
                 description="Response to a vote request from a follower to the candidate.">
        <field name="candidateTermId"          id="1" type="int64"/>
        <field name="logLeadershipTermId"      id="2" type="int64"/>
        <field name="logPosition"              id="3" type="int64"/>
        <field name="candidateMemberId"        id="4" type="int32"/>
        <field name="followerMemberId"         id="5" type="int32"/>
        <field name="vote"                     id="6" type="BooleanType"/>
    </sbe:message>

    <sbe:message name="NewLeadershipTerm"
                 id="53"
                 description="A leader has been successfully elected and has begun a new term.">
        <field name="logLeadershipTermId"       id="1"  type="int64"/>
        <field name="nextLeadershipTermId"      id="2"  type="int64"/>
        <field name="nextTermBaseLogPosition"   id="3"  type="int64"/>
        <field name="nextLogPosition"           id="4"  type="int64"/>
        <field name="leadershipTermId"          id="5"  type="int64"/>
        <field name="termBaseLogPosition"       id="6"  type="int64"/>
        <field name="logPosition"               id="7"  type="int64"/>
        <field name="leaderRecordingId"         id="8"  type="int64"/>
        <field name="timestamp"                 id="9" type="time_t"/>
        <field name="leaderMemberId"            id="10" type="int32"/>
        <field name="logSessionId"              id="11" type="int32"/>
        <field name="appVersion"                id="12" type="version_t"/>
        <field name="isStartup"                 id="13" type="BooleanType"/>
    </sbe:message>

    <!-- keep this under 32 - 8 = 24 bytes for efficiency -->
    <sbe:message name="AppendPosition"
                 id="54"
                 description="The highest position a follower has appended to their local log.">
        <field name="leadershipTermId"         id="1" type="int64"/>
        <field name="logPosition"              id="2" type="int64"/>
        <field name="followerMemberId"         id="3" type="int32"/>
        <field name="flags"                    id="4" type="uint8" sinceVersion="8"/>
    </sbe:message>

    <!-- keep this under 32 - 8 = 24 bytes for efficiency -->
    <sbe:message name="CommitPosition"
                 id="55"
                 description="The highest position reached by quorum of the cluster as determined by the leader.">
        <field name="leadershipTermId"         id="1" type="int64"/>
        <field name="logPosition"              id="2" type="int64"/>
        <field name="leaderMemberId"           id="3" type="int32"/>
    </sbe:message>

    <sbe:message name="CatchupPosition"
                 id="56"
                 description="The follower requests catchup from the leader starting at the given position.">
        <field name="leadershipTermId"         id="1" type="int64"/>
        <field name="logPosition"              id="2" type="int64"/>
        <field name="followerMemberId"         id="3" type="int32"/>
        <data  name="catchupEndpoint"          id="4" type="varAsciiEncoding"/>
    </sbe:message>

    <sbe:message name="StopCatchup"
                 id="57"
                 description="The leader informs the follower it can stop the catchup process.">
        <field name="leadershipTermId"         id="1" type="int64"/>
        <field name="followerMemberId"         id="2" type="int32"/>
    </sbe:message>

    <sbe:message name="AddPassiveMember"
                 id="70"
                 description="Add a member to the passive member list."
                 deprecated="12">
        <field name="correlationId"            id="1" type="int64"/>
        <data  name="memberEndpoints"          id="2" type="varAsciiEncoding"/>
    </sbe:message>

    <sbe:message name="ClusterMembersChange"
                 id="71"
                 description="Cluster Member list change, add or remove, response."
                 deprecated="12">
        <field name="correlationId"            id="1" type="int64"/>
        <field name="leaderMemberId"           id="2" type="int32"/>
        <data  name="activeMembers"            id="3" type="varAsciiEncoding"/>
        <data  name="passiveMembers"           id="4" type="varAsciiEncoding"/>
    </sbe:message>

    <sbe:message name="SnapshotRecordingQuery"
                 id="72"
                 description="Query a leader for the info on latest snapshot recordings."
                 deprecated="12">
        <field name="correlationId"            id="1"  type="int64"/>
        <field name="requestMemberId"          id="2"  type="int32"/>
    </sbe:message>

    <sbe:message name="SnapshotRecordings"
                 id="73"
                 description="Response to Snapshot recording query."
                 deprecated="12">
        <field name="correlationId"            id="1"  type="int64"/>
        <group name="snapshots"                id="3"  dimensionType="groupSizeEncoding"
               description="Snapshots of state for the consensus module and services.">
            <field name="recordingId"          id="4"  type="int64"/>
            <field name="leadershipTermId"     id="5"  type="int64"/>
            <field name="termBaseLogPosition"  id="6"  type="int64"/>
            <field name="logPosition"          id="7"  type="int64"/>
            <field name="timestamp"            id="8"  type="time_t"/>
            <field name="serviceId"            id="9"  type="int32"/>
        </group>
        <data  name="memberEndpoints"          id="10" type="varAsciiEncoding"/>
    </sbe:message>

    <sbe:message name="JoinCluster"
                 id="74"
                 description="Join the cluster officially, increasing the member size, transitioning from passive."
                 deprecated="12">
        <field name="leadershipTermId"         id="1" type="int64"/>
        <field name="memberId"                 id="2" type="int32"/>
    </sbe:message>

    <sbe:message name="TerminationPosition"
                 id="75"
                 description="Leader instructs members to terminate at given position.">
        <field name="leadershipTermId"         id="1" type="int64"/>
        <field name="logPosition"              id="2" type="int64"/>
    </sbe:message>

    <sbe:message name="TerminationAck"
                 id="76"
                 description="Follower acknowledges that it has reached termination position.">
        <field name="leadershipTermId"         id="1" type="int64"/>
        <field name="logPosition"              id="2" type="int64"/>
        <field name="memberId"                 id="3" type="int32"/>
    </sbe:message>

    <sbe:message name="BackupQuery"
                 id="77"
                 description="Query a leader for the latest backup information.">
        <field name="correlationId"            id="1"  type="int64"/>
        <field name="responseStreamId"         id="2"  type="int32"/>
        <field name="version"                  id="3"  type="version_t" presence="optional" sinceVersion="2"/>
        <data  name="responseChannel"          id="4"  type="varAsciiEncoding"/>
        <data  name="encodedCredentials"       id="5"  type="varDataEncoding"/>
    </sbe:message>

    <sbe:message name="BackupResponse"
                 id="78"
                 description="Response to backup query that includes all relevant information for backup operation.">
        <field name="correlationId"            id="1"  type="int64"/>
        <field name="logRecordingId"           id="2"  type="int64"/>
        <field name="logLeadershipTermId"      id="3"  type="int64"/>
        <field name="logTermBaseLogPosition"   id="4"  type="int64"/>
        <field name="lastLeadershipTermId"     id="5"  type="int64"/>
        <field name="lastTermBaseLogPosition"  id="6"  type="int64"/>
        <field name="commitPositionCounterId"  id="7"  type="int32"/>
        <field name="leaderMemberId"           id="8"  type="int32"/>
        <field name="memberId"                 id="17" type="int32" sinceVersion="10"
               description="id of member providing the response."/>
        <group name="snapshots"                id="9"  dimensionType="groupSizeEncoding"
               description="Snapshots of state for the consensus module and services.">
            <field name="recordingId"          id="10" type="int64"/>
            <field name="leadershipTermId"     id="11" type="int64"/>
            <field name="termBaseLogPosition"  id="12" type="int64"/>
            <field name="logPosition"          id="13" type="int64"/>
            <field name="timestamp"            id="14" type="time_t"/>
            <field name="serviceId"            id="15" type="int32"/>
        </group>
        <data  name="clusterMembers"           id="16" type="varAsciiEncoding"/>
    </sbe:message>

    <sbe:message name="HeartbeatRequest"
                 id="79"
                 description="Request a heartbeat response from a cluster member.">
        <field name="correlationId"            id="1"  type="int64"/>
        <field name="responseStreamId"         id="2"  type="int32"/>
        <data  name="responseChannel"          id="4"  type="varAsciiEncoding"/>
        <data  name="encodedCredentials"       id="5"  type="varDataEncoding"/>
    </sbe:message>

    <sbe:message name="HeartbeatResponse"
                 id="80"
                 description="Response to a heartbeat request.">
        <field name="correlationId"            id="1"  type="int64"/>
    </sbe:message>

    <sbe:message name="StandbySnapshot"
                 id="81"
                 description="Notify node(s) of the creation of a snapshot taken on a remote node"
                 sinceVersion="11">
        <field name="correlationId"            id="1"  type="int64"/>
        <field name="version"                  id="2"  type="int32"/>
        <field name="responseStreamId"         id="3"  type="int32"/>
        <group name="snapshots" id="4" dimensionType="groupSizeEncoding">
            <field name="recordingId"           id="5" type="int64"/>
            <field name="leadershipTermId"      id="6" type="int64"/>
            <field name="termBaseLogPosition"   id="7" type="int64"/>
            <field name="logPosition"           id="8" type="int64"/>
            <field name="timestamp"             id="9" type="int64"/>
            <field name="serviceId"             id="10" type="int32"/>
            <data  name="archiveEndpoint"        id="11" type="varAsciiEncoding"/>
        </group>
        <data name="responseChannel"          id="12"  type="varAsciiEncoding"/>
        <data name="encodedCredentials"       id="13"  type="varDataEncoding"/>
    </sbe:message>

    <!-- Serialisation of major entities in addition to others above that can be in a snapshot -->

    <sbe:message name="SnapshotMarker"
                 id="100"
                 description="Mark the beginning, end, or section index of a snapshot.">
        <field name="typeId"                   id="1" type="int64"/>
        <field name="logPosition"              id="2" type="int64"/>
        <field name="leadershipTermId"         id="3" type="int64"/>
        <field name="index"                    id="4" type="int32"/>
        <field name="mark"                     id="5" type="SnapshotMark"/>
        <field name="timeUnit"                 id="6" type="ClusterTimeUnit" sinceVersion="4" presence="optional"/>
        <field name="appVersion"               id="7" type="version_t" sinceVersion="4" presence="optional"/>
    </sbe:message>

    <sbe:message name="ClientSession"
                 id="102"
                 description="A serialised client session in the context of a service.">
        <field name="clusterSessionId"         id="1" type="int64"/>
        <field name="responseStreamId"         id="2" type="int32"/>
        <data  name="responseChannel"          id="3" type="varAsciiEncoding"/>
        <data  name="encodedPrincipal"         id="4" type="varDataEncoding"/>
    </sbe:message>

    <sbe:message name="ClusterSession"
                 id="103"
                 description="A serialised client session in the context of a Consensus Module.">
        <field name="clusterSessionId"         id="1" type="int64"/>
        <field name="correlationId"            id="2" type="int64"/>
        <field name="openedLogPosition"        id="3" type="int64"/>
        <field name="timeOfLastActivity"       id="4" type="time_t"/>
        <field name="closeReason"              id="5" type="CloseReason"/>
        <field name="responseStreamId"         id="6" type="int32"/>
        <data  name="responseChannel"          id="7" type="varAsciiEncoding"/>
    </sbe:message>

    <sbe:message name="Timer"
                 id="104"
                 description="A serialised scheduled timer.">
        <field name="correlationId"            id="1" type="int64"/>
        <field name="deadline"                 id="2" type="time_t"/>
    </sbe:message>

    <sbe:message name="ConsensusModule"
                 id="105"
                 description="Serialised state of the Consensus Module.">
        <field name="nextSessionId"            id="1" type="int64"/>
        <field name="nextServiceSessionId"     id="2" type="int64" sinceVersion="3" presence="optional"/>
        <field name="logServiceSessionId"      id="3" type="int64" sinceVersion="3" presence="optional"/>
        <field name="pendingMessageCapacity"   id="4" type="capacity_t" sinceVersion="3" presence="optional"/>
    </sbe:message>

    <sbe:message name="ClusterMembers"
                 id="106"
                 description="Serialised state of Cluster Members.">
        <field name="memberId"                 id="1" type="int32"/>
        <field name="highMemberId"             id="2" type="int32"/>
        <data  name="clusterMembers"           id="3" type="varAsciiEncoding"/>
    </sbe:message>

    <sbe:message name="PendingMessageTracker"
                 id="107"
                 description="Serialised state of the service pending message tracker.">
        <field name="nextServiceSessionId"     id="1" type="int64"/>
        <field name="logServiceSessionId"      id="2" type="int64"/>
        <field name="pendingMessageCapacity"   id="3" type="capacity_t"/>
        <field name="serviceId"                id="4" type="int32"/>
    </sbe:message>

</sbe:messageSchema>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy