Aren't you assuming that the parts finish in order here ? 
If they finish out of order ,the sizes will be in the wrong order.
Also, access to compressedPartSize is not thread safe..