If a runner performing a chunk migration cleanup yields, and during that time the node becomes non-primary, when the cleanup resumes the runner assumes the node is still primary and incorrectly attempts to write to the oplog, causing a fatal assertion.
The only configurations affected by this issue are sharded clusters where shards are replica sets, the balancer is enabled, and chunk migrations have occurred.
Under the conditions described above, the cleanup operation fails with an assert, and the primary node shuts down.
MongoDB 2.6 production releases up to 2.6.3 are affected by this issue.
The fix is included in the 2.6.4 production release.
During cleanup, always check the replica set status after yielding and abort the cleanup operation if the node is no longer primary.