Repository: tikv/tikv
File: components/cdc/src/endpoint.rs (Rust)

Code before:
    }

    fn on_deregister(&mut self, deregister: Deregister) {
        info!("cdc deregister"; "deregister" => ?deregister);
        fail_point!("cdc_before_handle_deregister", |_| {});
        match deregister {
            Deregister::Conn(conn_id) => {
                if let Some(conn) = self.connections.remove(&conn_id) {
                    conn.iter_downstreams(|_, region_id, downstream_id, _| {
                        self.deregister_downstream(region_id, downstream_id, None);
                    });
                } else {
                    info!("cdc connection already deregistered"; "conn_id" => ?conn_id);
                }
            }
            Deregister::Request {
                conn_id,
                request_id,
            } => {
                if let Some(conn) = self.connections.get_mut(&conn_id) {
                    for (region_id, downstream) in conn.unsubscribe_request(request_id) {
                        let err = Some(Error::Other("region not found".into()));
                        self.deregister_downstream(region_id, downstream, err);
                    }
                } else {
                    info!("cdc connection already deregistered for request deregister"; "conn_id" => ?conn_id, "request_id" => ?request_id);
                }
            }
            Deregister::Region {
                conn_id,
                request_id,
                region_id,
            } => {
                if let Some(conn) = self.connections.get_mut(&conn_id) {
                    if let Some(downstream) = conn.unsubscribe(request_id, region_id) {
                        let err = Some(Error::Other("region not found".into()));
                        self.deregister_downstream(region_id, downstream, err);
                    }
                } else {
                    info!("cdc connection already deregistered for region deregister"; "conn_id" => ?conn_id, "request_id" => ?request_id, "region_id" => region_id);
                }
            }
            Deregister::Downstream {
                conn_id,
                request_id,
                region_id,
                downstream_id,
                err,
            } => {
                let conn = match self.connections.get_mut(&conn_id) {
                    Some(conn) => conn,

Review comment (suggestion):
```suggestion
                    info!(
                        "cdc connection already deregistered for request deregister";
                        "conn_id" => ?conn_id, "request_id" => ?request_id,
                    );
```

Code after:
    }

    fn on_deregister(&mut self, deregister: Deregister) {
        info!("cdc deregister"; "deregister" => ?deregister);
        fail_point!("cdc_before_handle_deregister", |_| {});
        match deregister {
            Deregister::Conn(conn_id) => {
                if let Some(conn) = self.connections.remove(&conn_id) {
                    conn.iter_downstreams(|_, region_id, downstream_id, _| {
                        self.deregister_downstream(region_id, downstream_id, None);
                    });
                } else {
                    info!("cdc connection already deregistered"; "conn_id" => ?conn_id);
                }
            }
            Deregister::Request {
                conn_id,
                request_id,
            } => {
                if let Some(conn) = self.connections.get_mut(&conn_id) {
                    for (region_id, downstream) in conn.unsubscribe_request(request_id) {
                        let err = Some(Error::Other("region not found".into()));
                        self.deregister_downstream(region_id, downstream, err);
                    }
                } else {
                    info!("cdc connection already deregistered for request deregister"; 
                    "request_id" => ?request_id, "conn_id" => ?conn_id);
                }
            }
            Deregister::Region {
                conn_id,
                request_id,
                region_id,
            } => {
                if let Some(conn) = self.connections.get_mut(&conn_id) {
                    if let Some(downstream) = conn.unsubscribe(request_id, region_id) {
                        let err = Some(Error::Other("region not found".into()));
                        self.deregister_downstream(region_id, downstream, err);
                    }
                } else {
                    info!("cdc connection already deregistered for region deregister";
                      "request_id" => ?request_id, "region_id" => region_id, "conn_id" => ?conn_id);
                }
            }
            Deregister::Downstream {
                conn_id,
                request_id,
                region_id,
                downstream_id,
                err,
            } => {