Skip to content

Conversation

@mzur
Copy link
Contributor

@mzur mzur commented Sep 13, 2018

This fixes an off by one error with the number of segments of large objects uploaded to Swift.

The total number of segments was determined with round($streamSize/$segmentSize). In cases like $streamSize=24 and $segmentSize=10 this resulted in one segment too few that was uploaded. This has been fixed by simply omitting round(). I also updated the test which did not fail before by pure chance.

The total number of segments was determined with round($streamSize/$segmentSize).
In cases like $streamSize=24 and $segmentSize=10 this resulted in one segment
too few that was uploaded. This has been fixed by simply omitting round().
@mzur mzur force-pushed the fix-large-object-segments branch from 47cd7d3 to 0876029 Compare September 13, 2018 10:34
@coveralls
Copy link

coveralls commented Sep 13, 2018

Pull Request Test Coverage Report for Build 623

  • 4 of 4 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.002%) to 96.136%

Totals Coverage Status
Change from base Build 621: 0.002%
Covered Lines: 1692
Relevant Lines: 1760

💛 - Coveralls

@haphan haphan merged commit 3eba351 into php-opencloud:master Sep 14, 2018
@haphan
Copy link
Collaborator

haphan commented Sep 14, 2018

thanks @mzur 🚀

@mzur mzur deleted the fix-large-object-segments branch September 14, 2018 07:08
@ErwanGuillon
Copy link

When do you think you will tag a version for this? I'm not very confortable by using the dev branch in production and it's a blocker for me as I upload very large files.

Thanks for the hard work.

@dsnopek
Copy link

dsnopek commented Feb 4, 2019

Please tag a new version with this! We got bit by this bug, and 75% of our backups were corrupted. Of course, I tested one of the backups, but it was among the 25% where the last segment was greater than half the segment size so all the segments were uploaded. We lost a whole bunch of data due to this.

Now we're using the latest from Git, but I'm sure this bug will cause more people to have data loss issues!

@haphan
Copy link
Collaborator

haphan commented Feb 4, 2019

@dsnopek Thanks for bringing my attention to this issue. I’ve released 3.0.6 to address this.

My intention was to backport this fix to 2.x branch as well before tagging.

@ErwanGuillon
Copy link

Thanks @haphan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants