pingcap / tiflow

This repo maintains DM (a data migration platform) and TiCDC (change data capture for TiDB)
Apache License 2.0
421 stars 280 forks source link

DM worker panic when sync some tables #9834

Open lance6716 opened 11 months ago

lance6716 commented 11 months ago

What did you do?

panic: runtime error: comparing uncomparable type []uint8

goroutine 1734018212 [running]:
github.com/pingcap/tiflow/pkg/sqlmodel.(*RowChange).IsIdentityUpdated(0x2?)
        github.com/pingcap/tiflow/pkg/sqlmodel/reduce.go:106 +0x108
github.com/pingcap/tiflow/dm/syncer.genDMLsWithSameOp({0x4003862a80, 0x106, 0x267ad60?})
        github.com/pingcap/tiflow/dm/syncer/dml.go:466 +0x134
github.com/pingcap/tiflow/dm/syncer.(*DMLWorker).genSQLs(0x400ffb8150?, {0x4003862a80?, 0x3?, 0x3?})
        github.com/pingcap/tiflow/dm/syncer/dml_worker.go:285 +0x8c
github.com/pingcap/tiflow/dm/syncer.(*DMLWorker).executeBatchJobs(0x4002790780, 0x9, {0x4003862a80?, 0x106, 0x12c})
        github.com/pingcap/tiflow/dm/syncer/dml_worker.go:239 +0x110
github.com/pingcap/tiflow/dm/syncer.(*DMLWorker).executeJobs(0x4002790780, 0x9, 0x40620fd0e0)
        github.com/pingcap/tiflow/dm/syncer/dml_worker.go:184 +0x2c0
created by github.com/pingcap/tiflow/dm/syncer.(*DMLWorker).run
        github.com/pingcap/tiflow/dm/syncer/dml_worker.go:107 +0x5c

Here we may compare []byte, should use bytes.Compare for this type.

https://github.com/pingcap/tiflow/blob/5d6aaa216ef8b8fc36eb2ec91680dc59b923d9c5/pkg/sqlmodel/reduce.go#L105

lance6716 commented 11 months ago

by checking the panic stack, this problem can be workaround by setting multiple-rows to false

lance6716 commented 11 months ago

/assign @lance6716 @GMHDBJD

fubinzh commented 11 months ago

multiple-rows is false by default.

/severity moderate