robotLJW commented on a change in pull request #1204:
URL: 
https://github.com/apache/servicecomb-service-center/pull/1204#discussion_r779387657



##########
File path: datasource/etcd/ms.go
##########
@@ -1737,10 +1749,34 @@ func (ds *MetadataManager) DeleteTags(ctx 
context.Context, request *pb.DeleteSer
 
        key := path.GenerateServiceTagKey(domainProject, request.ServiceId)
 
-       resp, err := etcdadpt.TxnWithCmp(ctx,
-               etcdadpt.Ops(etcdadpt.OpPut(etcdadpt.WithStrKey(key), 
etcdadpt.WithValue(data))),
-               
etcdadpt.If(etcdadpt.NotEqualVer(path.GenerateServiceKey(domainProject, 
request.ServiceId), 0)),
-               nil)
+       opts := etcdadpt.Ops(etcdadpt.OpPut(etcdadpt.WithStrKey(key), 
etcdadpt.WithValue(data)))
+       if datasource.EnableSync {
+               domain := util.ParseDomain(ctx)
+               project := util.ParseProject(ctx)
+               taskOpt, err := eutil.GenTaskOpts(&eutil.TaskOpt{
+                       Domain:       domain,
+                       Project:      project,
+                       Action:       sync.DeleteAction,
+                       ResourceType: datasource.ResourceKV,
+                       Resource:     data,
+                       Opts:         map[string]string{"key": key},
+               })
+               if err != nil {
+                       return &pb.DeleteServiceTagsResponse{
+                               Response: pb.CreateResponse(pb.ErrInternal, 
err.Error()),
+                       }, err
+               }
+               tombstoneOpt, err := eutil.GenTombstoneOpts(domain, project, 
datasource.ResourceKV, key)

Review comment:
       这个 GenTombstoneOpts,并没有写db,而是伴随后面会加入 opts ,最终 Txn 一同写入




-- 
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]


Reply via email to