Skip to content

Feature Request: Expose etcd AutoSyncInterval in EtcdConf #5619

@DCjanus

Description

@DCjanus

Request

Could go-zero expose etcd client's AutoSyncInterval in EtcdConf?

For example, users could disable etcd endpoint auto-sync when needed:

Etcd:
  Hosts:
    - 127.0.0.1:2479
  Key: device.rpc
  AutoSyncInterval: 0s # disables auto-sync

Why

go-zero's etcd discovery creates the etcd client internally, so users cannot
control this option today.

This matters when applications should keep using the configured Etcd.Hosts,
such as an etcd LB / VIP / proxy.

The underlying etcd client already supports this through
clientv3.Config.AutoSyncInterval.

Related case

Related: #5005. The user configured 127.0.0.1:2479, but auto-sync tried to
connect to 127.0.0.1:2379 after reading etcd membership.

Disabling auto-sync was suggested there, which looks like a reasonable option
for that kind of setup. It just is not available through EtcdConf today.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions