Updated Replication (markdown)

Chris Lu 2020-12-13 12:21:07 -08:00
parent 0cd99c0b19
commit 1e9e6b1c65

@ -59,6 +59,14 @@ Now when requesting a file key, an optional "dataCenter" parameter can limit the
http://localhost:9333/dir/assign?dataCenter=dc1
```
## Write and Read
For consistent read and write, a quorum `W + R > N` is required. In SeaweedFS, `W = N` and `R = 1`.
In plain words, all the writes are strongly consistent and all N replica should be successful. If one of the replica fails to write, the whole write request will fail. This makes read request fast since it does not need to check and compare other replicas.
For failed write request, there might be some replicas written. These replica would be deleted. Since volumes are append only, the physical volume size may deviate over time.
## Fix replication
If one replica is missing, there are no automatic repair right away. This is to prevent over replication due to transient volume sever failures or disconnections. In stead, the volume will just become readonly. For any new writes, just assign a different file id to a different volume.