fix: support RM delete undo log request#1023
fix: support RM delete undo log request#1023everfid-ever wants to merge 9 commits intoapache:masterfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1023 +/- ##
==========================================
+ Coverage 56.49% 57.32% +0.83%
==========================================
Files 266 268 +2
Lines 17484 17511 +27
==========================================
+ Hits 9877 10038 +161
+ Misses 6772 6637 -135
- Partials 835 836 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR adds support for RM delete undo log requests, addressing issue #1016. The main fix corrects a type error in the UndoLogDeleteRequest structure where the SaveDays field was incorrectly defined as MessageType (an int type meant for message type codes) instead of int16 for representing the number of days.
Key changes:
- Fixed
SaveDaysfield type fromMessageTypetoint16inUndoLogDeleteRequest - Added processor implementation to handle undo log deletion requests from TC server
- Added codec for encoding/decoding
UndoLogDeleteRequestmessages - Registered both processor and codec in initialization functions
- Added comprehensive test coverage including edge cases, integration tests, and benchmarks
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/protocol/message/request_message.go | Fixed SaveDays field type from MessageType to int16 in UndoLogDeleteRequest struct |
| pkg/protocol/codec/undolog_delete_req_codec.go | Added codec for encoding/decoding undo log delete requests with proper serialization of ResourceId, SaveDays, and BranchType |
| pkg/protocol/codec/undolog_delete_req_codec_test.go | Added comprehensive tests for codec including encoding/decoding, round-trip tests, edge cases, and benchmarks |
| pkg/protocol/codec/codec.go | Registered UndoLogDeleteRequestCodec in the codec manager initialization |
| pkg/remoting/processor/client/rm_delete_undolog_processor.go | Added processor to handle undo log delete requests with logging and placeholder for actual deletion logic |
| pkg/remoting/processor/client/rm_delete_undolog_processor_test.go | Added comprehensive tests for processor including various branch types, edge cases, context handling, integration tests, and benchmarks |
| pkg/remoting/processor/client/init.go | Added initDeleteUndoLog() call to register the delete undo log processor |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Code-Fight
left a comment
There was a problem hiding this comment.
Why is the issue link gone?
The account that submitted the issue has been deleted. |
already added |
Could you please help me check the integration test code? Thanks :) |
|
Plz fix the CI problems. |
I reopen a new PR, plz check the new one, thanks |
Fixes #1016 Codec error when TC server sends UndoLogDeleteRequest (type 111)
What does this PR do?
This PR fixes a critical codec error that occurs when seata-go clients communicate with Seata TC server v1.8.0+. The TC server periodically sends UndoLogDeleteRequest messages (message type 111) to clean up old undo log records, but seata-go was missing the necessary codec and processor to handle these messages, causing the client to fail after 2-3 minutes of operation.
Problem: When seata-go clients run for approximately 2-3 minutes, they encounter codec errors because the TC server sends TYPE_RM_DELETE_UNDOLOG (type code 111) messages, but seata-go doesn't have a registered codec to decode this message type.
Impact: This causes seata-go clients to fail during normal operation with Seata TC server v1.8.0+, making the client unstable for production use.
What changes in this PR?