-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: 阮老师小分队 - 基于异步HTTP实现p2p分布式协议加速S3 Object存取实现 #2
base: master
Are you sure you want to change the base?
Conversation
I am very sorry that due to the time taken by the laboratory, some documents are not fully completed, which may affect your understanding of this project. |
Core features: (p2p-with-tracker)
The general process:
Follow-up work:
核心特点:(p2p-with-tracker)
大致流程:
后续工作: 1.目前还在测试使用mDNS和DHT的方式,由于手动实现有些困难因此在这个版本中暂未实现,另外,可以结合gossip将节点的缓存信息广播出去,减少为tracker的依赖或者直接拆分tracker的任务到其他节点中。 |
for piece in pieces { | ||
let piece_id: String = piece.get_checksum().clone(); | ||
match PIECE_CACHE.get(&piece_id.clone()) { | ||
Some(piece) => { | ||
file.extend(piece); | ||
}, | ||
None => { | ||
debug!("Piece: {:?} not found", piece); | ||
continue; | ||
}, | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible that if a piece of a file is not found, the file will become broken with pieces missed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Reto911 Thanks for the suggestion :) yes, in ruan_lao_shi_xiao_fen_dui/p2p-with-tracker/src/server/logic/file.rs
lines 250 and 275 I've tried to fetch that file slice from the S3 raw storage and from the other online nodes, if it's unavailable it means that the slice is temporarily unavailable and cannot be stitched together into a complete file.
I think I can add a periodic retry to the case, or report the slice missing to S3/Tracker for more complete processing.
// Update global time | ||
GLOBAL_TIMESTAMP_CACHE.insert(timestamp); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you tell me why did you insert the timestamp into it? By the way, what does GLOBAL_TIMESTAMP_CACHE
do exactly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Reto911 Hello, this cache is used in calc_download_time in ruan_lao_shi_xiao_fen_dui/p2p-with-tracker/src/server/logic/file.rs
to test how long it takes the current node to download a file, it is done with a simple It is a simple list to access the timestamp information, and to calculate the time it takes to download a file, you just need to pop up the latest time and calculate the difference directly.
For multi-node testing, I didn't use this form directly, but instead calculated the time spent on calls to the synchronized HTTP interface.
提交信息