tiflow
tiflow copied to clipboard
run as 'syncpoint', can't use password encode by base64
What did you do?
- set 'enable-sync-point=true'
- create changefeed as ' tidb -> cdc -> tidb', downstream password was encoded by base64
What did you expect to see?
create changefeed success and sync data to download stream
What did you see instead?
changefeed was occurs erros :
[CDC:ErrMySQLQueryError]fail to query session variable allow_auto_random_explicit_insert: Error 1045: Access denied for user 'cdc'@'10.2.100.15' (using password: YES)
Versions of the cluster
v6.5.0 (all versions which support syncpoint)
https://github.com/pingcap/tiflow/blob/release-6.5/cdc/sink/mysql/mysql.go#L135 here is function NewMySQLSink, and call 'GetTestDB' to create mysql-connection. in this function, it will decode the password when occur error on sql.Open. The function 'GetTestDB' definition is as follows : https://github.com/pingcap/tiflow/blob/release-6.5/pkg/sink/mysql/db_helper.go#L235-L250
the follows code is syncpoint when create mysql-connection. you can see it did not handle error generated by create mysql-connection(sql.Open):
https://github.com/pingcap/tiflow/blob/release-6.5/cdc/sink/mysql/mysql_syncpoint_store.go#L119-L132
BTW: if use base64 to encode password, the DDLSink will be created failed. owner.newDDLSink -> owner.ddlSinkInitializer -> factory.New -> mysql.NewMySQLDDLSink -> mysql.CreateMySQLDBConn
/severity major
cc @knull-cn @flowbehappy This issue only affects v6.5.x.
I will fix it in the upcoming days.
fixed by https://github.com/pingcap/tiflow/pull/11162
/found customer
/remove-found customer