summaryrefslogtreecommitdiff
path: root/utils.cc
diff options
context:
space:
mode:
authorGilad Arnold <garnold@chromium.org>2015-02-05 12:24:49 -0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-02-06 14:17:24 +0000
commit063181c4fb0ab86c6aaba307c0cc00b901c4522b (patch)
treeea46a68b0cbb73a9c802ea1d2f0bce67a997309b /utils.cc
parent3c3807cf75c532d476a04b9d61610f09c301b50b (diff)
update_engine: Fix delta generator mishandling of unchanged blocks.
In a previous CL:181515 I made the delta generator filter out blocks that were being MOVEed onto themselves, subsequently discarding empty MOVE operations entirely. This resulted in unchanged blocks being considered "unwritten". However, I did not realize that the delta generator was scanning and packing all these blocks into one large REPLACE_BZ at the end, without even checking whether any of them has changed in the new image relative to the old image. Recently, we realized that this causes deltas between largely similar (or worse, identical) images to bloat. It should be noted that this inefficiency existed before the aforementioned feature was introduced, although it only applied to truly unused filesystem blocks. However, such blocks being mostly zero, they compressed well and likely did not affect the size of the delta much. This CL fixes the problem by addressing the general problem: we do not overwrite the content of previously unwritten blocks if they are identical to the ones in the old image. Furthermore, if none of the unwritten blocks has changed, we omit the said REPLACE_BZ operation entirely. In the case of a delta between identical image, the result is a payload with no operations at all (a good thing). In the particular case of the failing panther_moblab build (see bug) this successfully reduces the delta size from 625 MB to 331 bytes (!). CQ-DEPEND=CL:246673 BUG=chromium:453659 TEST=Unit tests TEST=Generated delta payload for previously failing panther_moblab build TEST=Generated and tested two deltas for link (trivial N-to-N, real N-1) Change-Id: I1c4e33d7cca5d59ba6725322970a329c1a3f7688 Reviewed-on: https://chromium-review.googlesource.com/246670 Tested-by: Gilad Arnold <garnold@chromium.org> Reviewed-by: Don Garrett <dgarrett@chromium.org> Commit-Queue: Gilad Arnold <garnold@chromium.org>
Diffstat (limited to 'utils.cc')
0 files changed, 0 insertions, 0 deletions