Similarityoung commented on PR #745:
URL: 
https://github.com/apache/incubator-seata-go/pull/745#issuecomment-2551733655

   佬们,能教教孩子吗
   
   我注意到 java 那里实现方式是先找一千个需要删除的日志,记录 xid 再进行删除,如此循环直到找不出日志为止。
   
   然后我注意到再 go 里面 fence 里有个channel : traversalCleanChannel是用来放需要删除日志的 xid和 
brandId 的。我有考虑过直接通过定时任务查询需要删除的日志,把他们的 xid 和 brandId 放进这个 channel 中。但是我感觉这样通过 
channel 一次删除一条日志的效率太低了。
   
   所以我就重新写了一个定时任务,在每天零点的时候执行,也没有查找日志再删除,而是直接进行日志删除,并采用循环直到没有日志需要删除。
   
   最后我的问题是:
   
   1. 我这样设计是否合理,我有考虑另一种方式实现:先查询日志,再一个个插入进 channel 中,然后 channel 一次性删除多条日志。
   
   2. 目前我写完了那个定时任务,但是我不知道,在 fence初始化的哪里对这个定时任务进行调用
   
   3. 目前我只对删除 sql 进行了测试,对于定时任务的测试我不是很清楚该如何测试


-- 
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: notifications-unsubscr...@seata.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@seata.apache.org
For additional commands, e-mail: notifications-h...@seata.apache.org

Reply via email to