-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #883 from philips/add-consistent-note
Documentation: add note about consistent=true
- Loading branch information
Showing
1 changed file
with
15 additions
and
0 deletions.
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 |
---|---|---|
|
@@ -833,6 +833,8 @@ curl -L http://127.0.0.1:4001/v2/keys/afile -XPUT --data-urlencode [email protected] | |
|
||
### Read Consistency | ||
|
||
#### Read from the Master | ||
|
||
Followers in a cluster can be behind the leader in their copy of the keyspace. | ||
If your application wants or needs the most up-to-date version of a key then it should ensure it reads from the current leader. | ||
By using the `consistent=true` flag in your GET requests, etcd will make sure you are talking to the current master. | ||
|
@@ -843,6 +845,19 @@ The client is told the write was successful and the keyspace is updated. | |
Meanwhile F2 has partitioned from the network and will have an out-of-date version of the keyspace until the partition resolves. | ||
Since F2 missed the most recent write, a client reading from F2 will have an out-of-date version of the keyspace. | ||
|
||
Implementation notes on `consistent=true`: If the leader you are talking to is | ||
partitioned it will be unable to determine if it is not currently the master. | ||
In a later version we will provide a mechanism to set an upperbound of time | ||
that the current master can be unable to contact the quorom and still serve | ||
reads. | ||
|
||
### Read Linearization | ||
|
||
If you want a read that is fully linearized you can use a `quorum=true` GET. | ||
The read will take a very similar path to a write and will have a similar | ||
speed. If you are unsure if you need this feature feel free to email etcd-dev | ||
for advice. | ||
|
||
## Lock Module (*Deprecated and Removed*) | ||
|
||
The lock module is used to serialize access to resources used by clients. | ||
|