You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.
通过supernode下载了一次文件,supernode会把文件缓存到磁盘,并记录meta和md5。如果把supernode关掉再重开,再次请求同一文件,supernode会从缓存中加载文件。
我在实测中发现,supernode会出现下述log: 2020-12-10 17:02:40.698 ERRO sign:19254 : failed to process cache by quick taskID(27a30b928b929b57bdb8c4d96b046f24912bc107034c06a2abcc37784dabc984): failed to get key 27a30b928b929b57bdb8c4d96b046f24912bc107034c06a2abcc37784dabc984 from map: failed to get key 27a30b928b929b57bdb8c4d96b046f24912bc107034c06a2abcc37784dabc984 from map: {"Code":0,"Msg":"data not found"}
Question
通过supernode下载了一次文件,supernode会把文件缓存到磁盘,并记录meta和md5。如果把supernode关掉再重开,再次请求同一文件,supernode会从缓存中加载文件。
我在实测中发现,supernode会出现下述log:
2020-12-10 17:02:40.698 ERRO sign:19254 : failed to process cache by quick taskID(27a30b928b929b57bdb8c4d96b046f24912bc107034c06a2abcc37784dabc984): failed to get key 27a30b928b929b57bdb8c4d96b046f24912bc107034c06a2abcc37784dabc984 from map: failed to get key 27a30b928b929b57bdb8c4d96b046f24912bc107034c06a2abcc37784dabc984 from map: {"Code":0,"Msg":"data not found"}
查看了源码,是因为在processCacheByQuick函数中,执行getPieceMD5sByTaskID时,在map中查不到key所致,这在supernode重启后是必然的,此处错误发生后会重新读取磁盘中的缓存文件并计算一遍md5。但是在这处代码下面有readPieceMD5s,可以从缓存的md5文件中取出md5进行快速校验,但是因为已经发生错误,不会执行这一步。
我想知道,作者原本的设计,在supernode重启后,是想对md5进行快速校验,还是重新对缓存文件计算一遍md5?
The text was updated successfully, but these errors were encountered: