[SERVER-26956] Remove moveChunk from sharding/cursor_timeout.js and fix test Created: 08/Nov/16  Updated: 06/Dec/22  Resolved: 23/Oct/17

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Dianna Hohensee (Inactive) Assignee: [DO NOT USE] Backlog - Sharding Team
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Duplicate
duplicates SERVER-28414 sharding/cursor_timeout.js can timeou... Closed
Assigned Teams:
Sharding
Backwards Compatibility: Fully Compatible
Participants:
Linked BF Score: 0

 Description   

Executing a migration in cursor_timeout.js appears to have no purpose. There isn't even an assert that the migration succeeded. ensurePrimaryShard (already done in the test) is sufficient to assure that the data is on a specific shard.

The moveChunk operation in fact fails every time with a ChunkTooBig error. And then the mongod connected cursor is created against the moveChunk's source shard. So if the moveChunk does succeed, the test actually fails because the cursor is opened against a shard that does not have that collection and thus .next() on that cursor fails.

Instead of inserting 200 documents, the test should insert far fewer and include a batchSize setting on the find commands to ensure that the cursor remains open. There is then also no reason to insert huge documents: documents with a string field with length 2^17. Perhaps the huge documents were because there was or is a data size limit on cursor returns, but batchSize should take care of it.



 Comments   
Comment by Dianna Hohensee (Inactive) [ 23/Oct/17 ]

cursor_timeout.js has been modified by SERVER-28414 since this ticket was filed, and this problem has gone away. The

{chunkSize: 1}

parameter was removed from the ShardingTest instantiated in cursor_timeout.js, so the migration can now succeed without a ChunkTooBig error and is asserted to succeeded.

Comment by Dianna Hohensee (Inactive) [ 09/Nov/16 ]

It's possible that this JS test was originally intended to exercise the mongos' parallel query of multiple shards, with timeout of those cursors. In which case, the moveChunk should be kept, but splitChunk added.

Generated at Thu Feb 08 04:13:43 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.