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
Describe the bug
If I modify a chunk file in /cyfs/data/chunk-cache , thenI get the chunk by stack.ndn_service().get_data(), chunk-manager not check the correctness of the file hash in the disk
To Reproduce
Modify a chunk file in /cyfs/data/chunk-cache
Get the chunk through stack.ndn_service().get_data()
Expected behavior
The chunk-manager should check the correctness of the chunk, because the chunk content does not match the chunk_id, get_data should return an error
The chunk_id is calculated through the hash of the full text of the chunk content, and inconsistencies should be prohibited
System information
Linux/Windows
The text was updated successfully, but these errors were encountered:
The chunks data currently managed by cyfs-stack mainly includes the following two types:
Chunks managed by the chunk-manager
These chunks will be added to the {cyfs}/data/chunk-cache directory and are responsible for read and write operations by the chunk-manager.
External files
These are usually external files and directories added directly through the trans.add_file function, which are managed by the stack using ndc and tracker to manage the corresponding files and internal chunks data.
Therefore, from this perspective, the "external files" may not be very reliable, as they are files on the user's device, such as OOD or PC, which may be moved, deleted, modifyed, or even replaced. So when the stack needs to read the corresponding chunk, it may no longer exist, or the content of the chunk may have changed. To prevent reading the wrong chunk, the stack adds an extra level of validation when reading chunks from these "external files," which checks if the hash of the chunk's data matches the chunk-id.
However, for the files inside chunk-cache, it is clear that they are managed by the chunk-manager of the stack, and they should not be modified externally on the OOD. Users should not modify or replace these files themselves. Therefore, adding a hash validation when reading from here might be a performance waste.
Another challenge is that chunk-manager supports memory-mapped file mode for reading and managing chunk-cache, so adding hash validation functionality may also be challenging.
If chunk hash mentioned in #204 detection is introduced on top of this, it would be a good mechanism for chunk-manager managed chunks and should solve the problem
Describe the bug
If I modify a chunk file in /cyfs/data/chunk-cache , thenI get the chunk by stack.ndn_service().get_data(), chunk-manager not check the correctness of the file hash in the disk
To Reproduce
Expected behavior
System information
Linux/Windows
The text was updated successfully, but these errors were encountered: