Giter VIP home page Giter VIP logo

iblocksync's People

Contributors

phrozenbyte avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

andrey-utkin

iblocksync's Issues

Parallelize hashing and transmitting blocks

As soon as the local instance has both hashes of the first block, it might request this block from the sender and forward it to the receiver. However, it should be possible to disable parallelization, because reading hashes and reading/writing blocks at the same time will cause a heavy slowdown on HDD storages (unless network speed is slower anyway...).

Remotes then also need threading for computing hashes (async, i.e. we compute the next hash even though we didn't send the previous hash yet) and sending/receiving blocks (sync, i.e. we only send/receive one block at a time). We must furthermore add package identifiers to the network protocol (to distinguish hashes and blocks) and ensure that we don't accidentally mix packages mid-data (this can indeed happen because we use stdout/stdin; maybe with a third thread responsible for communications?).

Syncing images of different sizes with a non-divisible block size fails

Trying to sync images of different sizes with a non-divisible block size (e.g. syncing a source image of 10 MiB to a target image of 12 MiB with a block size of 4 MiB) fails with the following error:

RuntimeError: Can't sync images of different sizes with a non-divisible block size

This is expected behaviour for now. You must either switch to a divisible block size (e.g. 2 MiB), or ensure that both images match in size, or sync to a non-existing (or zero-length) target image.

The reason is that the last blocks of the images don't match in size (e.g. 2 MiB for the source image, but 4 MiB for the target image). This will not only cause the last block to be always considered different, but will also confuse communications. Right now we don't really use a network protocol, but rather dump raw data. This works because all components are synced and know how many bytes they must read or write. However, due to the size mismatch the sender will send just 2 MiB for the last block, but the receiver will expect 4 MiB - what will cause the program to hang indefinitely.

The only solution is to implement a proper network protocol with package sizes. Also see #3.

Catch BrokenPipeError and resume sync

However, make sure that this doesn't break wrapper scripts, because they might not be resumable (i.e. make this an option, not the default behaviour).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.