Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

ticdc: Refactor CheckIsTiDB function to remove the returned error #11505

Closed
4 tasks done
wlwilliamx opened this issue Aug 21, 2024 · 0 comments · Fixed by #11506
Closed
4 tasks done

ticdc: Refactor CheckIsTiDB function to remove the returned error #11505

wlwilliamx opened this issue Aug 21, 2024 · 0 comments · Fixed by #11506
Assignees
Labels
area/ticdc Issues or PRs related to TiCDC. question Further information is requested. type/enhancement The issue or PR belongs to an enhancement.

Comments

@wlwilliamx
Copy link
Contributor

Before asking a question, make sure you have

What is your question?

Description:
In the CheckIsTiDB function, the current implementation returns an error which is no need for the external callers. In earlier versions, this function returned an error along with a boolean value, allowing callers to differentiate between network-related issues and the absence of TiDB. However, since the specific error content wasn't critical to the logic—external callers only needed to know whether the downstream was TiDB—the decision was made to simplify the function. External callers should not handle the error returned here because even if the downstream is not TiDB, TiCDC should still function properly. For more details, refer to #11214.

The primary goal of this issue is to refactor the function to remove the error return type. Instead of returning an error, we will log a warning if an issue occurs while querying the TiDB version, as the error content itself is not critical to the logic. This change will simplify the function while maintaining awareness of potential network issues through logging.

Action Items:

  1. Remove the error return value from CheckIsTiDB.
  2. Log a warning instead of an error when row.Scan() fails.
  3. Add comments to clarify the logic and reason for not returning errors.
@wlwilliamx wlwilliamx added the question Further information is requested. label Aug 21, 2024
@asddongmen asddongmen added type/enhancement The issue or PR belongs to an enhancement. area/ticdc Issues or PRs related to TiCDC. labels Sep 9, 2024
@ti-chi-bot ti-chi-bot bot closed this as completed in 0848c61 Sep 10, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
area/ticdc Issues or PRs related to TiCDC. question Further information is requested. type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants