diff --git a/internal/distributed/cdc/service.go b/internal/distributed/cdc/service.go index 8229e4b744..d336a8ffb4 100644 --- a/internal/distributed/cdc/service.go +++ b/internal/distributed/cdc/service.go @@ -91,12 +91,8 @@ func (s *Server) stop() { // Stop CDC service. s.cdcServer.Stop() - // Stop etcd - if s.etcdCli != nil { - if err := s.etcdCli.Close(); err != nil { - log.Warn("cdc stop etcd client failed", zap.Error(err)) - } - } + // Don't close s.etcdCli here because it's a shared instance from kvfactory. + // The kvfactory.CloseEtcdClient() will be called in roles.go to close it properly. log.Info("cdc stop done") }