bigbigbigwaterbucket commented on code in PR #1085:
URL:
https://github.com/apache/incubator-seata-go/pull/1085#discussion_r3004986503
##########
pkg/rm/tcc/fence/handler/tcc_fence_wrapper_handler.go:
##########
@@ -290,3 +301,58 @@ func (handler *tccFenceWrapperHandler)
traversalCleanChannel(db *sql.DB) {
}
}
}
+
+func (handler *tccFenceWrapperHandler) drainCacheTask() {
+ ticker := time.NewTicker(cleanInterval)
+ defer ticker.Stop()
+
+ for {
+ select {
+ case <-ticker.C:
+ handler.cacheMutex.Lock()
+
+ if handler.logCache.Len() == 0 {
+ handler.cacheMutex.Unlock()
+ continue
+ }
+
+ handler.dbMutex.RLock()
+ db := handler.db
+ handler.dbMutex.RUnlock()
+ if db == nil {
+ handler.cacheMutex.Unlock()
+ continue
+ }
+
+ var batch []model.FenceLogIdentity
Review Comment:
已实现缓存重新入队的功能,并在失败分支Rollback。另外traversalCleanChannel函数也存在静默漏删与Rollback问题,不过有initLogCleanTask对超过24h未清理的数据进行写回,请问相关逻辑还需要修改吗?
--
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]