[SERVER-27797] Getmore tells out real reason when collection was dropped due to rename Created: 24/Jan/17  Updated: 06/Feb/17  Resolved: 25/Jan/17

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

Type: Improvement Priority: Major - P3
Reporter: CenZheng Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File getmore_tells_col_dropped_due_to_rename.patch    
Participants:

 Description   

Hi,

Now a getMore request will tells out the real reason that the collection was dropped during getMore calls. But if the collection was dropped due to a renameCollection with dropTarget option was set, it will only return out a cursor not found error. Can we also tell out this reason so that user can know what really happens. The attached patch can simply do this, pls have a look. Thanks!



 Comments   
Comment by CenZheng [ 06/Feb/17 ]

Hi Charlie,
I got your point, you are right, thanks!

Comment by Charlie Swanson [ 24/Jan/17 ]

Hi zhcn381,

We appreciate your work making this patch, but unfortunately we cannot accept it. The code you've modified will be executed in many scenarios, not just when the collection was dropped due to a rename. For instance, if a getMore was sent with an unknown cursor id, or if the getMore was sent to a different node by mistake, or possibly for other reasons. The error message you provide is too specific for the variety of things that can lead to us not being able to find the cursor, and could be confusing for users if the cursor did not exist for one of the reasons mentioned above.

We do currently have some infrastructure for keeping track of why a cursor was killed, but we do not preserve that information longer than the lifetime of one request. Preserving that information would complicate the already complicated lifecycle of a cursor, and add to our memory footprint.

Thank you for your consideration. I'd also like to point you to our guidelines for contributing to MongoDB. If you would like to contribute to MongoDB in the future, please consult with that page.

Thanks,
Charlie

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