Skip to content

Commit

Permalink
Replication changes
Browse files Browse the repository at this point in the history
  • Loading branch information
as51340 committed May 14, 2024
1 parent 7d2cbc3 commit 0c95d17
Showing 1 changed file with 3 additions and 21 deletions.
24 changes: 3 additions & 21 deletions pages/configuration/replication.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,6 @@ import { Callout } from 'nextra/components'

# Replication

<Callout type="warning">

Memgraph 2.9 introduced a new configuration flag
`--replication-restore-state-on-startup`, which is `false` by default.

Instances need to remember their role and configuration details in a replication
cluster upon restart, and the `--replication-restore-state-on-startup` needs to be
set to `true` when first initializing the instances and remain `true` throughout
the instances' lifetime for replication to work correctly. If the flag is set to `false`,
MAIN can't communicate with instance, because each REPLICA has a UUID of MAIN which can communicate
with it, and it is set up only on instance registration. In case the flag is set to `false`,
the way to go forward is first to unregister the instance on MAIN and register it again.

When reinstating a cluster, it is advised first to initialize the MAIN
instance, then the REPLICA instances.

</Callout>

When distributing data across several instances, Memgraph uses replication to
provide a satisfying ratio of the following properties, known from the CAP theorem:
Expand Down Expand Up @@ -132,10 +115,9 @@ cluster](#set-up-a-replication-cluster).
Each Memgraph instance has the role of the MAIN instance when it is first
started.

Also, by default, each crashed instance restarts as a MAIN instance disconnected
from any replication cluster. To change this behavior, set the
`--replication-restore-state-on-startup` to `true` when first initializing the
instance.
Also, by default, each crashed instance restarts with its previous role (MAIN as MAIN, REPLICA as REPLICA).
To change this behavior, set the `--replication-restore-state-on-startup` to `false` when
first initializing the instance. In this way, all instances will get restarted as MAIN.

### Assigning the REPLICA role

Expand Down

0 comments on commit 0c95d17

Please sign in to comment.