everfid-ever opened a new pull request, #1074: URL: https://github.com/apache/incubator-seata-go/pull/1074
Fixes https://github.com/apache/incubator-seata-go/issues/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? Added UndoLogDeleteRequest message structure File: pkg/protocol/message/request_message.go Added UndoLogDeleteRequest struct with fields: ResourceId (string), SaveDays (int16), BranchType (BranchType) Implemented GetTypeCode() method returning MessageTypeRmDeleteUndolog Implemented codec for UndoLogDeleteRequest File: pkg/protocol/codec/undolog_delete_req_codec.go Created UndoLogDeleteRequestCodec with Encode(), Decode(), and GetMessageType() methods Properly handles serialization/deserialization of all fields including the int16 SaveDays field Registered codec in codec manager File: pkg/protocol/codec/codec.go Registered UndoLogDeleteRequestCodec in the Init() function Implemented message processor File: pkg/remoting/processor/client/rm_delete_undolog_processor.go Created rmDeleteUndoLogProcessor to handle incoming undo log delete requests Added initDeleteUndoLog() function to register the processor Currently logs the request (actual undo log deletion logic to be implemented later) Integrated processor registration File: pkg/remoting/processor/client/init.go Added initDeleteUndoLog() call to RegisterProcessor() function Comprehensive test coverage Files: undolog_delete_req_codec_test.go, rm_delete_undolog_processor_test.go Added unit tests for codec encode/decode functionality Added integration tests for processor Added edge case tests and benchmarks Test coverage includes: normal cases, empty values, boundary values, and round-trip encoding/decoding -- 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]
