[SERVER-26797] Illegal cast to StaleConfigException is possible after moveChunk which fails with StaleConfigException Created: 26/Oct/16  Updated: 19/Nov/16  Resolved: 31/Oct/16

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 3.4.0-rc1
Fix Version/s: 3.4.0-rc3

Type: Bug Priority: Major - P3
Reporter: Kaloian Manassiev Assignee: Misha Tyulenev
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

Any moveChunk command where the caller has stale version should be able to exercise it.

Sprint: Sharding 2016-11-21
Participants:

 Description   

The moveChunk command on the shard was made rejoinable for the purpose of supporting recovery of active migrations after balancer step down.

A command which rejoins will take the status from the command which executed the actual move operation and call uassertStatusOK on it.

However, the SendStaleConfig error code is treated specially and the resulting DBException is later cast to StaleConfigException. In this case, such a typecast will be illegal and may lead to accessing invalid memory.



 Comments   
Comment by Githook User [ 31/Oct/16 ]

Author:

{u'username': u'mikety', u'name': u'Misha Tyulenev', u'email': u'misha@mongodb.com'}

Message: SERVER-26797 protect upcast to StaleConfigException from DBException
Branch: master
https://github.com/mongodb/mongo/commit/2142a7da82ced30ba3e7564d049e1f0021c909bb

Comment by Kaloian Manassiev [ 28/Oct/16 ]

Discussed the issue in person and we decided to remove the SendStaleConfigException which is thrown from MigrationSourceManager and replace it with a regular DBException with error code of StaleEpoch. Originally, when moveChunk was initiated by mongos it was possible that a stale mongos was used and the SendStaleConfigException was necessary in order to bring it up to date. However, in 3.4, with the balancer running on the CSRS primary, having stale chunk information is no longer possible and this exception is of no use.

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