Replies: 1 comment
-
This might've been answered already for you somehow after a month of posting this, but the magic is actually in here: Where you're notified when a new index is processed, this plays together with the read loop to find the current index: etcd/server/etcdserver/v3_server.go Lines 725 to 776 in 5073af6 Which in turn queries the raft-node via, which explains this very well: Lines 182 to 188 in 31d9664
I hope this answers your questions somewhat, the reads of the raft nodes don't get persisted on the WAL which is why you don't see any fsync. |
Beta Was this translation helpful? Give feedback.
-
Hi! We are moving from an etcd v2 to an etcd v3 backend and noticed an interesting performance discrepancy between the two. Using strace and the etcd metrics, we like to track the fsync frequency of etcd nodes to ensure we don't wear out the SSD.
In the v2 backend, a get with --quorum resulted in an fsync and a raft commit.
In the v3 backend, a get with --consistency=l (linearizable get) does not cause an fsync or a raft commit.
While this is great news for us from the performance standpoint, I am concerned that this results in a less strict consistency than in the v2 backend. Was this an optimization the team made in the transition to the MVCC, or have some consistency guarantees been lost between the two backends? If anyone who is very familiar with how etcd interacts with raft could help me here, that would be greatly appreciated!
To reproduce:
start an etcd cluster
curl -s -XGET $ETCD/metrics | grep 'etcd_server_proposals_applied'
curl -s -XGET $ETCD/metrics | grep 'fsync_duration_seconds_count'
optionally: start a background strace
ETCDCTL_API=3 etcdctl put foo bar
observe that v3 puts increment the raft commit index
ETCDCTL_API=2 etcdctl set foo bar
observe that v2 sets increment the raft commit index
ETCDCTL_API=3 etcdctl get foo
observe that v3 gets do not increment the raft commit index
ETCDCTL_API=2 etcdctl get foo --quorum
observe that v2 quorum gets do increment the raft commit index.
Beta Was this translation helpful? Give feedback.
All reactions