-
Notifications
You must be signed in to change notification settings - Fork 288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dm: CompareGTID uses an extremely slow algorithm to check emptiness and slowed down replication speed #9676
Comments
the |
(Internal reference: https://internal.pingcap.net/jira/browse/ONCALL-4846) The issue, as highlighted in the flamegraph, is that CompareGTID uses tiflow/dm/pkg/binlog/position.go Lines 368 to 370 in 7397cfd
so everytime we var (
emptyMySQLGTIDSet, _ = gmysql.ParseMysqlGTIDSet("")
emptyMariaDBGTIDSet, _ = gmysql.ParseMariadbGTID("")
)
func CompareGTID(gSet1, gSet2 gmysql.GTIDSet) (int, bool) {
gSetIsEmpty1 := gSet1 == nil || gSet1.Equal(emptyMySQLGTIDSet) || gSet1.Equal(emptyMariaDBGTIDSet)
gSetIsEmpty2 := gSet2 == nil || gSet2.Equal(emptyMySQLGTIDSet) || gSet2.Equal(emptyMariaDBGTIDSet)
) ideally (This similar pattern also appears as |
/severity major |
/found gs |
Since all devs seems to be busy with other stuff I've asked @feran-morgan-pingcap to try to deliver a PR by Oct 7th. cc @GMHDBJD |
What did you do?
What did you expect to see?
Replication works normally and quickly.
What did you see instead?
CompareGTID
shows up significantly in the worker CPU profile and blocking the main thread, significantly slowing down replication speedVersions of the cluster
DM version (run
dmctl -V
ordm-worker -V
ordm-master -V
):6.5.1
Upstream MySQL/MariaDB server version:
5.7.29-32-log
Downstream TiDB cluster version (execute
SELECT tidb_version();
in a MySQL client):6.5.3
How did you deploy DM: tiup or manually?
k8s (operator)
Other interesting information (system version, hardware config, etc):
current status of DM cluster (execute
query-status <task-name>
in dmctl)(paste current status of DM cluster here)
The text was updated successfully, but these errors were encountered: