Upgrading: Differential Hunk Migration
Closed, ResolvedPublic

Description

Differential stores the source text for code reviews in a "hunk" table. This table has two formats, a "legacy" format and a "modern" format. The modern format is better, and supports compression and other features.

New hunks have been written to the "modern" table for a very long time (perhaps a year or more?) but installs which have been around for longer than that may still have some old hunks stored in the "legacy" format. In a few weeks years, we will add a mandatory hunk format migration which migrates any legacy hunks to modern hunk storage.

For installs with a long history, this may take some time. This migration is safe to run online (while Phabricator is running), and you can potentially avoid maintenance downtime by running this migration manually in advance of the forced migration.

Determining If You Are Affected

To determine if you are affected, run bin/storage probe and look at the size of the differential_hunk table in the phabricator_differential database.

  • If this table has size 0.0 MB, your install has no legacy hunks. You are not affected at all and can ignore everything happening here.
  • If this table has a small size (up to about 100 MB), your install has some legacy hunks but the migration should happen fairly quickly (a few minutes). You can run the migration manually if you prefer, or wait for the forced migration.
  • If this table is large (bigger than 100 MB) you may be able to reduce maintenance downtime significantly by running the migration manually in advance of the forced migration.

Manual Migration

To run the migration manually, run this command after upgrading to HEAD of master or stable (2015 Week 26 or later):

phabricator/ $ ./bin/hunks migrate

This command can safely be run while Phabricator is online and serving normal traffic.

Context and Discussion

See T8475 and linked objects for technical context and discussion.

epriestley updated the task description. (Show Details)
epriestley raised the priority of this task from to Normal.
epriestley added projects: Guides, Differential.
epriestley added subscribers: epriestley, joshuaspence.

I marked D13222 as closing this as I figured that when D13222 lands this will no longer be relevant.

tndrH added a subscriber: tndrH.Jun 25 2015, 10:52 AM
epriestley updated the task description. (Show Details)Jun 27 2015, 11:36 AM
epriestley updated the task description. (Show Details)
Yomi added subscribers: Yomi, beber.Jun 27 2015, 3:37 PM
AlexandreJozwicki moved this task from v2 (UI/Mobile) to Backlog on the Differential board.
epriestley closed this task as Resolved.Feb 18 2017, 2:27 AM
epriestley claimed this task.

This has now been live for a while without anyone hitting real issues other than the minor hiccup in T12090. T8475 is an eventual followup.