taosdata / kafka-connect-tdengine

GNU Affero General Public License v3.0
15 stars 5 forks source link

fix:Solve the problem of discarding extra records by adding table names. #20

Closed ecnuhail closed 2 years ago

ecnuhail commented 2 years ago

To fix https://github.com/taosdata/kafka-connect-tdengine/issues/19#issue-1312679718

The function unrollAndRetry will be called after a fixed number of retries. The purpose is to insert the correct records in the same batch of records into the database, and the wrong records will be discarded.

During the iteration, because of an exception, the sql connection is closed and the database name is lost, resulting in an error when inserting into the database regardless of whether the record is correct or not.

Fix this problem by re-obtaining the database name before getting the connection.

huolibo commented 2 years ago

how about delete writer.close() in unrollAndRetry function?

ecnuhail commented 2 years ago

I have tried your suggestion and it work in my environment. Commit has been updated.

huolibo commented 2 years ago

Thanks for submitting the code