[SERVER-45779] Throw Stale Shard Version when collection is unknown on getOwnershipFilter Created: 27/Jan/20  Updated: 29/Oct/23  Resolved: 04/Mar/20

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

Type: Task Priority: Major - P3
Reporter: Marcos José Grillo Ramirez Assignee: Marcos José Grillo Ramirez
Resolution: Fixed Votes: 0
Labels: PM-1645-Milestone-1
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-45778 Rename getOrphanFilter to getOwnershi... Closed
depends on SERVER-45904 Create a standalone collection shardi... Closed
is depended on by SERVER-32198 Missing collection metadata on the sh... Closed
is depended on by SERVER-46272 Make callers of keyBelongsToMe() to n... Closed
Problem/Incident
causes PYTHON-2154 test_examples.TestTransactionExamples... Closed
Related
related to SERVER-47268 noop_createIndexes_not_blocked_by_txn... Closed
related to SERVER-47911 Prevent stale_mongos_and_restarted_sh... Closed
is related to SERVER-46679 Transaction test fails with Stale Sha... Closed
Backwards Compatibility: Fully Compatible
Sprint: Sharding 2020-02-24, Sharding 2020-03-09
Participants:

 Description   

After completion of SERVER-45778 throw Stale Shard Version if the collection data is unknown, that is, if the metadata has not been loaded yet, and if any code path is not ready to receive and handle the exception, investigate the case and handle the exception if appropiate.



 Comments   
Comment by Shane Harvey [ 06/Mar/20 ]

Thanks Kal, I've opened SERVER-46679.

Comment by Kaloian Manassiev [ 06/Mar/20 ]

shane.harvey, if this is a change in behaviour between 4.2 and 4.4 then it is a server bug. Most likely MongoS is not retrying somewhere it should. Can you please file a separate ticket and include the above information plus the logs from the drivers test?

Also please indicate whether it is failing with sharded or unsharded collection.

Comment by Shane Harvey [ 06/Mar/20 ]

I think this change causes a transactions documentation test to fail on sharded clusters with the following error (PYTHON-2154):
"Transaction 58ec29bc-f257-43ce-81ed-2db10a7da770:3 was aborted on statement 0 due to: an error from cluster data placement change :: caused by :: Encountered error from localhost:27217 during a transaction :: caused by :: sharding status of collection hr.employees is not currently available for filtering and needs to be recovered from the config server"

Link to the failing "update_employee_info" transaction test: https://github.com/mongodb/mongo-python-driver/blob/1fdfb9864b3c0614f0f46add0bb7a25ebb8d2e77/test/test_examples.py#L902

Does this indicate a bug in the server or is there something we need to do differently to use transactions on sharded clusters in 4.4? Note that the test does not shard the collection or enable sharding on the database.

Comment by Githook User [ 04/Mar/20 ]

Author:

{'name': 'Marcos José Grillo Ramírez', 'username': 'm4nti5', 'email': 'marcos.grillo@mongodb.com'}

Message: SERVER-45779 Throw Stale Shard Version when collection is unknown on getOwnershipFilter
Branch: master
https://github.com/mongodb/mongo/commit/246ed94e7fc900e034775c2d60bedde2bf92bce2

Generated at Thu Feb 08 05:09:41 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.