Browse Source

Documentation/upgrades: fix 3.4 guides

Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
Gyuho Lee 6 years ago
parent
commit
508203db15
1 changed files with 25 additions and 1 deletions
  1. 25 1
      Documentation/upgrades/upgrade_3_4.md

+ 25 - 1
Documentation/upgrades/upgrade_3_4.md

@@ -35,7 +35,7 @@ OK
 +etcdctl put foo bar
 ```
 
-#### Make `ETCDCTL_API=3 etcdctl` default
+#### Make `etcd --enable-v2=false` default
 
 [`etcd --enable-v2=false`](https://github.com/etcd-io/etcd/pull/10935) is now the default.
 
@@ -87,6 +87,29 @@ _, err := kvc.Get(ctx, "a")
 +  if s.Code() == codes.Canceled
 ```
 
+#### Require `grpc.WithBlock` for client dial
+
+[The new client balancer][client-design] uses an asynchronous resolver to pass endpoints to the gRPC dial function.
+
+In order to create a client object synchronously with gRPC connection, pass `grpc.WithBlock` to dial options:
+
+```diff
+import (
+	"time"
+	"go.etcd.io/etcd/clientv3"
++	"google.golang.org/grpc"
+)
+
++// "grpc.WithBlock()" to block until the underlying connection is up
+ccfg := clientv3.Config{
+  Endpoints:            []string{"localhost:2379"},
+  DialTimeout:          time.Second,
++ DialOptions:          []grpc.DialOption{grpc.WithBlock()},
+  DialKeepAliveTime:    time.Second,
+  DialKeepAliveTimeout: 500 * time.Millisecond,
+}
+```
+
 #### Deprecating `etcd_debugging_mvcc_db_total_size_in_bytes` Prometheus metrics
 
 v3.4 promotes `etcd_debugging_mvcc_db_total_size_in_bytes` Prometheus metrics to `etcd_mvcc_db_total_size_in_bytes`, in order to encourage etcd storage monitoring.
@@ -580,3 +603,4 @@ COMMENT
 ```
 
 [etcd-contact]: https://groups.google.com/forum/#!forum/etcd-dev
+[client-design]: https://github.com/etcd-io/etcd/blob/master/Documentation/learning/design-client.md