SEPURI-SAI-KRISHNA commented on issue #13341: URL: https://github.com/apache/seatunnel/issues/13341#issuecomment-7000820954
Checked on dev: this is real. When a batch fails with a row-level SQL error (SQLState class 22 or 23), `JdbcSinkWriter.handleRowLevelBatchFailure` reports every pending row of the batch as failed, with the same exception, and clears the batch. - With `auto_commit = false` the batch is also rolled back. `SinkErrorToMysqlIT#testSinkBatchConstraintErrorRoutedToMysqlAtClose` pins this on Zeta: 3 valid rows and 1 duplicate key in one batch give 0 rows in the target and 4 rows in the error table. - With the default `auto_commit = true` nothing is rolled back, so depending on the driver, rows already applied can also be reported as errors. `error-handling.md` notes the dropped valid rows but says only the bad record is reported. I can work on this. Plan for `auto_commit = false`: after the rollback, replay the batch rows one at a time in their original order, so valid rows are written and only failing ones are reported. In auto-commit mode a replay could write rows twice, so I would handle that mode separately. The E2E would then expect 3 rows and 1 error. @zhangshenghang does this fit the design of #10306? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
