Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions pages/clustering/high-availability/ha-commands-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,16 @@ Memgraph High Availability (HA) cluster.
## Cluster registration commands

<Callout type="warning">
**Important:** **All registration commands (adding coordinators and registering
data instances) must be executed on the *same* coordinator.** You may choose any
**Important:** You may choose any
coordinator for the initial setup; it automatically becomes the leader. After
setup, the choice no longer matters.
</Callout>

<Callout type="info">
All queries can be run on any coordinator. If currently the coordinator is not a leader, the query will be automatically forwarded to the current leader and executed there.
This is because Raft protocol specifies that only leader should accept changes in the cluster.
</Callout>

### `ADD COORDINATOR`

Adds a coordinator to the cluster.
Expand Down Expand Up @@ -78,7 +82,6 @@ REMOVE COORDINATOR coordinatorId;

{<h4 className="custom-header"> Behavior & implications </h4>}

- Must be executed on the **leader** coordinator.
- Leader coordinator **cannot** remove itself. To remove the leader, first
trigger a leadership change.

Expand Down Expand Up @@ -106,7 +109,6 @@ of each instance.

{<h4 className="custom-header"> Behavior & implications </h4>}

- Must be executed on the **leader** coordinator.
- Only bolt server can be updated.

{<h4 className="custom-header"> Example </h4>}
Expand Down Expand Up @@ -294,8 +296,7 @@ SHOW INSTANCE;

### `SHOW REPLICATION LAG`

Shows replication lag (in committed transactions) for all instances. Must be run
on the **leader**.
Shows replication lag (in committed transactions) for all instances.

```cypher
SHOW REPLICATION LAG;
Expand Down Expand Up @@ -326,7 +327,5 @@ FORCE RESET CLUSTER STATE;

{<h4 className="custom-header"> Implications </h4>}

- Must be executed on the **leader** coordinator.


<CommunityLinks/>
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,20 @@ Below is a cleaned-up categorization.

#### Coordinator → Coordinator RPCs

| RPC | Purpose | Description |
| -------------------- | ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| `ShowInstancesRpc` | Follower requests cluster state from leader | Sent by a follower coordinator to the leader coordinator when a user executes `SHOW INSTANCES` through the follower. |
| RPC | Purpose | Description |
| ------------------------ | -------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| `ShowInstancesRpc` | Follower requests cluster state from leader. | Sent by a follower coordinator to the leader coordinator when a user executes `SHOW INSTANCES` through the follower. |
| `AddCoordinatorRpc` | Follower requests adding coordinator. | Sent by a follower coordinator to the leader coordinator when a user executes `ADD COORDINATOR` through the follower. |
| `RemoveCoordinatorRpc` | Follower requests removing coordinator. | Sent by a follower coordinator to the leader coordinator when a user executes `REMOVE COORDINATOR` through the follower. |
| `RegisterInstanceRpc` | Follower requests registering an instance. | Sent by a follower coordinator to the leader coordinator when a user executes `REGISTER INSTANCE` through the follower. |
| `UnregisterInstanceRpc` | Follower requests unregistering an instance. | Sent by a follower coordinator to the leader coordinator when a user executes `UNREGISTER INSTANCE` through the follower. |
| `SetInstanceToMainRpc` | Follower requests updating main instance. | Sent by a follower coordinator to the leader coordinator when a user executes `SET INSTANCE TO MAIN` through the follower. |
| `DemoteInstanceRpc` | Follower requests demoting and instance. | Sent by a follower coordinator to the leader coordinator when a user executes `DEMOTE INSTANCE` through the follower. |
| `UpdateConfigRpc` | Follower requests updating config. | Sent by a follower coordinator to the leader coordinator when a user executes `UPDATE CONFIG` through the follower. |
| `ForceResetRpc` | Follower requests resetting cluster state. | Sent by a follower coordinator to the leader coordinator when a user executes `FORCE RESET` through the follower. |
| `ShowInstancesRpc` | Follower requests showing cluster state. | Sent by a follower coordinator to the leader coordinator when a user executes `SHOW INSTANCES` through the follower. |
| `GetRoutingTableRpc` | Follower requests a routing table. | Sent by a follower coordinator to the leader coordinator when a user connect using `bolt+routing` through the follower. |
| `CoordReplicationLagRpc` | Follower requests replication lag info. | Sent by a follower coordinator to the leader coordinator when a user executes `SHOW REPLICATION LAG` through the follower. |


#### Coordinator → Data Instance RPCs
Expand Down