Skip to content

Commit de10275

Browse files
author
Anthony Yeh
committed
Merge pull request #1184 from enisoc/etcd
etcd: Require strong consistency (quorum reads).
2 parents d60d519 + d80d4c4 commit de10275

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

go/vt/etcdtopo/client.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ import (
99
)
1010

1111
func newEtcdClient(machines []string) Client {
12-
return etcd.NewClient(machines)
12+
c := etcd.NewClient(machines)
13+
// Vitess requires strong consistency mode for etcd.
14+
if err := c.SetConsistency(etcd.STRONG_CONSISTENCY); err != nil {
15+
panic("failed to set consistency on etcd client: " + err.Error())
16+
}
17+
return c
1318
}
1419

1520
// Client contains the parts of etcd.Client that are needed.

0 commit comments

Comments
 (0)