twitter/gizzmo — pull request #21 by stuhood (2012-02-14 21:18:50+00:00)
Title: DS-40: All shards in a source tree should be preserved until after copies

Currently if a rebalance is done while WriteOnlyShard-wrapped shards are present, those shards are removed during the PREPARE phase of the process, which is entirely wrong. No data should be removed until the CLEANUP phase.

Shards that were wrapped in a source template were not triggering the "copy_source?" check, and so they were being removed eagerly during the first phase of a transform. This is a patch to replace the copy_source? check with a "in_copied_subtree?" check, so that all members of a subtree that is being copied are protected until after copies have completed.