AlexStocks commented on code in PR #1074: URL: https://github.com/apache/incubator-seata-go/pull/1074#discussion_r2990518170
########## pkg/remoting/processor/client/rm_delete_undolog_processor.go: ########## @@ -0,0 +1,50 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package client + +import ( + "context" + "fmt" + + "seata.apache.org/seata-go/v2/pkg/protocol/message" + "seata.apache.org/seata-go/v2/pkg/remoting/getty" + "seata.apache.org/seata-go/v2/pkg/util/log" +) + +func initDeleteUndoLog() { + rmDeleteUndoLogProcessor := &rmDeleteUndoLogProcessor{} + getty.GetGettyClientHandlerInstance().RegisterProcessor(message.MessageTypeRmDeleteUndolog, rmDeleteUndoLogProcessor) +} + +type rmDeleteUndoLogProcessor struct{} + +func (r *rmDeleteUndoLogProcessor) Process(ctx context.Context, rpcMessage message.RpcMessage) error { + req, ok := rpcMessage.Body.(message.UndoLogDeleteRequest) + if !ok { + return fmt.Errorf("invalid message body type: %T", rpcMessage.Body) + } + + log.Infof("Received undo log delete request: resourceId=%s, saveDays=%d, branchType=%v", + req.ResourceId, req.SaveDays, req.BranchType) + + // TODO: Implement actual undo log deletion logic here Review Comment: [P1] PR 标题写的是“support RM delete undo log request”,但这里收到请求后只打日志然后直接 `return nil`,真正的 undo_log 删除逻辑完全没有落地。TC 把请求当成 one-way 发过来后,RM 这边会表现成“处理成功”,实际旧 undo_log 一条都不会删,功能语义和提交标题不一致。建议至少把删除入口接到现有 undo_log 清理实现上;如果这次只打算先接协议,应该显式返回未实现错误并把 PR 范围缩小。 -- 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]
