HomePhabricator

Fix an issue where "bin/differential migrate-hunk" could decompress data

Description

Fix an issue where "bin/differential migrate-hunk" could decompress data

Summary:
Fixes T12986. I caught this bug in the changes from D18584: when we moved a large hunk to file storage, we would decompress it but keep the "deflated" flag. This could cause confusion when loading it later. I missed this in testing since I wasn't exhaustive enough in checking hunks and didn't run into a compressed one.

Instead of compressing on save(), compress during the normal workflow.

We currently never advise users to run this workflow so I didn't bother trying to clean up possible existing migrations.

Test Plan:

  • Ran bin/differential migrate-hunk on compressed hunks, moving them to and from file storage. Saw them work correctly and remain compressed.
  • Created new small (uncompressed) and large (compressed) hunks, verified they work properly and get compressed (if applicable).
  • Used bin/cache purge --caches changeset to clear changeset caches and make sure the actual table was being hit.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T12986

Differential Revision: https://secure.phabricator.com/D18624