Cherry pick https://github.com/etcd-io/etcd/pull/12319 to 3.4. Signed-off-by: Benjamin Wang <wachao@vmware.com>