Update read_chunk() PB protocol to return trimmed chunks #25
Loading…
Reference in a new issue
No description provided.
Delete branch "ku/trim-pb-protocol-2"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
trimed
array of chunk_pos at read_chunk messagetrimmed
are only filled only whenneeds_trimmed
is true which is false by defaultspawn
tospawn_link
)Will follow with actual trim implementation later.
Discussion result:
So, next comes...
Currently the border trimming happens in CR client, because this makes repair life easier. This would be a point for discussion, maybe it'd better avoid repairing a whole GB chunk by reading a single byte.
乙!+1, many thanks!
@slfritchie Thank you for review, btw what do you think of slicing the chunk returned by flu to fit client-requested size at CR client?
If the original chunk was 1MB and the client asked for 1KB in the middle of the original chunk, why should the server send 1023 extra KB? (The "reductio ad absurdum" https://en.wikipedia.org/wiki/Reductio_ad_absurdum argument suggests that for any read_chunk request, the server should send the whole file ... send all files ... send the entire Internet!
^_^
)I like the idea of making the clients to as much "extra work" as is reasonable ... but I feel that sending the original chunk (send the entire Internet) isn't a good use of network bandwidth: the server memory & CPU is cheaper than network b/w?
@slfritchie That makes sense. I pushed the fix at #27.