-
Notifications
You must be signed in to change notification settings - Fork 557
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Replication Docs #1055
Open
vazois
wants to merge
7
commits into
microsoft:main
Choose a base branch
from
vazois:vazois/docs-replication-update
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+22
−3
Open
Update Replication Docs #1055
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
84ccde6
change mentions of MMR to FAT
vazois 7ec3798
add diskless replication description
vazois 36a96ef
Merge branch 'main' into vazois/docs-replication-update
vazois 5cd5a84
Merge branch 'main' into vazois/docs-replication-update
vazois 5dda9cb
fix typos
vazois de6242a
Merge branch 'vazois/docs-replication-update' of https://github.com/v…
vazois e6775a2
Fix typo in replication documentation
badrishc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -48,10 +48,10 @@ In addition, newly configured replicas, added to the cluster, could face longer | |||||
The cluster operator can choose between various replication options to achieve a trade-off between performance and durability. | ||||||
A summary of these options is shown below: | ||||||
|
||||||
- Main Memory Replication (MMR) | ||||||
- Fast AOF Truncation (FAT) | ||||||
This option forces the primary to aggressively truncate the AOF so it does not spill into disk. It can be used in combination with aof-memory option which determines the maximum AOF memory buffer size. | ||||||
When a replica attaches to a primary with MMR turned on, the AOF is not guaranteed to be truncated which may result in writes being lost. | ||||||
To overcome this issue MMR should be used with ODC. | ||||||
When a replica attaches to a primary with FAT turned on, the AOF is not guaranteed to be truncated which may result in writes being lost. | ||||||
To overcome this issue FAT should be used with ODC. | ||||||
- On Demand Checkpoint (ODC) | ||||||
This option forces the primary to take a checkpoint if no checkpoint is available when replica tries to attach and recover. If a checkpoint becomes or was availalbe and the CCRO has not been truncated, then | ||||||
the primary will lock it to prevent truncation while a replica is recovering. In this case, they AOF log could spill to disk as the AOF in memory buffer becomes full. | ||||||
|
@@ -226,6 +226,25 @@ replica_announced:1 | |||||
192.168.1.26:7001> | ||||||
``` | ||||||
|
||||||
# Diskless Replication | ||||||
|
||||||
When AOF gets truncated, full synchronization requires taking a checkpoint and sending that checkpoint over to the attaching replica. | ||||||
This operation can be expensive because it involves multiple I/O operations at the primary and replica. | ||||||
For this reason, we added a variant of full synchronization called diskless replication. | ||||||
This is implemented using a streaming checkpoint that allows clients to continue issuing read and writes at the primary while attaching replicas synchronize. | ||||||
To enable diskless replication the server needs to be started with the following flags | ||||||
|
||||||
--repl-diskless-sync=true | ||||||
This is used to enable diskless replication | ||||||
|
||||||
--repl-diskless-sync-delay=\<seconds\>. | ||||||
This is used to determine how many seconds to wait before starting the full sync, in order to give the opportunity to multiple replicas to attach and receive the streaming checkpoint. | ||||||
|
||||||
There is no additional requirements to that of using the aforementioned flags in order to leverage diskless replication. | ||||||
The APIs for mapping replicas remains the same (i.e. CLUSTER REPLICATE, REPLICAOF etc.). | ||||||
|
||||||
Note that diskless replication does not take an actual checkpoint. | ||||||
Hence every time a full sync is performed, the AOF is not automatically truncated (unless FAT flag is used). | ||||||
This happens to ensure durability in the event of a failure which will not be possible if the AOF gets truncated without a persitent checkpoint. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct the spelling 'persitent' to 'persistent'.
Suggested change
Copilot is powered by AI, so mistakes are possible. Review output carefully before use. |
||||||
However, the store version gets incremented to ensure consistency across different instances that may be fully synced at different times. | ||||||
Users can still utilize SAVE/BGSAVE commands or --aof-size-limit to periodically take a checkpoint and safely truncate the AOF. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adjust the verb to 'remain' to agree with the plural subject 'APIs'.
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.