memgraph / documentation

The official documentation for Memgraph open-source graph database.
https://memgraph.com/docs
MIT License
9 stars 5 forks source link

Document the diagram for replication SYNC in more details. #286

Open antejavor opened 7 months ago

antejavor commented 7 months ago

When Memgraph is in SYNC mode, the diagram does not clearly indicate what happens with the MAIN instance if SYNC REPLICA fails to commit. It also does not show what happens to other SYNC replicas if one SYNC replicas fails to commit.

Here is the screenshot from the documentation that indicates that an exception is thrown, but the description of the effects on other instances is not clear.

image

Related and open because of the following question: https://discord.com/channels/842007348272169002/890968055339958292/1167051891121852467

vpavicic commented 7 months ago

expand these sentences

SYNC - After committing a transaction, the MAIN instance will communicate the changes to all REPLICA instances running in SYNC mode and wait until it receives a response or information that a timeout is reached. SYNC mode ensures consistency and partition tolerance (CP), but not availability for writes. If the primary database has multiple replicas, the system is highly available for reads. But, when a replica fails, the MAIN instance can't process the write due to the nature of synchronous replication.

The following diagrams express the behavior of the MAIN instance in cases when SYNC REPLICA doesn't answer within the expected timeout, and the transaction is uncommitted from all instances in the cluster.

vpavicic commented 7 months ago

The REPLICA instance is then set into a RECOVERY state, where it remains until it is fully synchronized with the MAIN instance#synchronizing-instances.

Fix this

vpavicic commented 7 months ago

maybe add the roll-back element to the diagrams