See the attached scripts. The offending counts that cause the below error are in test_movechunk.js:L45-46
At a high level, the function in test_movechunk.js that causes this, `testDollarPrefix()`, creates 800 documents, { '$x' : i } for i from -400 to 400, and tries to do a movechunk from a 2.4 mongod to a 2.6 mongod and back, and asserts that the cluster and individual shards have the correct document count. The error text is as below:
m30001| 2014-02-24T12:27:55.196-0500 [migrateThread] warning: cannot remove pending chunk [{ _id: MinKey }, { _id: -300.0 }), this shard does not contain the chunk m30001| 2014-02-24T12:27:55.196-0500 [migrateThread] warning: cannot remove pending chunk [{ _id: MinKey }, { _id: -300.0 }), this shard does not contain the chunk m30000| Mon Feb 24 12:27:57.452 [conn1] assertion 13388 [test.emptyfield] shard version not ok in Client::Context: this shard contains versioned chunks for test.emptyfield, but no version set in request ( ns : test.emptyfield, received : 0|0||000000000000000000000000, wanted : 3|0||530b81115a14bccd6ce91c33, send ) ( ns : test.emptyfield, received : 0|0||000000000000000000000000, wanted : 3|0||530b81115a14bccd6ce91c33, send ) ns:test.$cmd query:{ count: "emptyfield", query: {}, fields: {} } m30000| Mon Feb 24 12:27:57.452 [conn1] ntoskip:0 ntoreturn:-1 m30000| Mon Feb 24 12:27:57.452 [conn1] stale version detected during query over test.$cmd : { $err: "[test.emptyfield] shard version not ok in Client::Context: this shard contains versioned chunks for test.emptyfield, but no version set in request ( n...", code: 13388, ns: "test.emptyfield", vReceived: Timestamp 0|0, vReceivedEpoch: ObjectId('000000000000000000000000'), vWanted: Timestamp 3000|0, vWantedEpoch: ObjectId('530b81115a14bccd6ce91c33') } 2014-02-24T12:27:57.454-0500 Error: stale config on lazy receive :: caused by :: $err: "[test.emptyfield] shard version not ok in Client::Context: this shard contains versioned chunks for test.emptyfield, but no version set in request ( n..." ( ns : test.emptyfield, received : 0|0||000000000000000000000000, wanted : 3|0||530b81115a14bccd6ce91c33, recv ) at src/mongo/shell/collection.js:55 failed to load: /Users/vkarpov/qa/QA/QA-418/test_movechunk.js
Let me know if y'all need any more info.