beatenevo opened a new pull request, #1180: URL: https://github.com/apache/incubator-seata-go/pull/1180
<!-- Thanks for sending a pull request! --> <!-- Please make sure you have read and understood the contributing guidelines --> - [ ] I have registered the PR [changes](https://github.com/apache/incubator-seata-go/tree/master/changes). **What this PR does**: - Handles `db.Begin()` errors in the TCC fence log cleaner. - Prevents the DAO and `Commit()` from being called with a nil transaction. - Rolls back transactions when batch deletion fails and preserves rollback errors. - Handles commit failures and requeues failed batches. - Applies bounded retry handling with structured logs and a Prometheus metric when retries are exhausted. - Drains the final partial batch during shutdown and reports unprocessed identities. **Which issue(s) this PR fixes**: <!-- *Automatically closes linked issue when PR is merged. Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`. _If PR is about `failing-tests or flakes`, please post the related issues/tests in a comment and do not use `Fixes`_* --> Fixes #1174 **Special notes for your reviewer**: The transaction handling for fence-log cleanup is centralized so that Begin, delete, rollback, and commit failures follow the same error path. Failed batches remain eligible for retry instead of being silently discarded. Validation completed: - `go test -count=10 ./pkg/rm/tcc/fence/handler` - `go test -race ./pkg/rm/tcc/fence/handler` - `go test ./pkg/rm/tcc/fence/...` - `go vet ./pkg/rm/tcc/fence/...` **Does this PR introduce a user-facing change?**: No. This is an internal reliability fix for the TCC fence log cleaner. <!-- If no, just write "NONE" in the release-note block below. If yes, a release note is required: Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required". --> -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
