[SERVER-60550] migration_util function may miss some response errors when submitting remote commands through sendToRecipient() Created: 08/Oct/21  Updated: 29/Oct/23  Resolved: 18/Oct/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 5.0.3, 4.4.9, 5.1.0-rc0
Fix Version/s: 5.2.0, 4.4.11, 5.0.4, 5.1.0-rc2

Type: Bug Priority: Major - P3
Reporter: Paolo Polato Assignee: Paolo Polato
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v5.1, v5.0, v4.4
Sprint: Sharding EMEA 2021-10-18, Sharding EMEA 2021-11-01
Participants:
Linked BF Score: 24

 Description   

In BFG-872835 it could be observed the following sequence:

  1. a chunk migration reaches the commit phase
  2. the migration coordinator issues a request for removing the related range deletion document
  3. the recipient steps down before deleting the document - supposedly returning an error
  4. sendToRecipient() should detect the remote error and raise an exception to interrupt the migration coordinator - but nothing happens.

The root cause of this is considered to lie in the use of Shard::CommandResponse::getEffectiveStatus() for processing remote errors - for write operation requests getStatusFromWriteCommandReply() is generally preferred.



 Comments   
Comment by Githook User [ 28/Oct/21 ]

Author:

{'name': 'Paolo Polato', 'email': 'paolo.polato@mongodb.com', 'username': 'ppolato'}

Message: SERVER-60550 use getStatusFromWriteCommandReply() in migration_util.cpp
Branch: v4.4
https://github.com/mongodb/mongo/commit/fcaf9dead44cc6e6245f29d236bd662f9fa4cd10

Comment by Githook User [ 21/Oct/21 ]

Author:

{'name': 'Paolo Polato', 'email': 'paolo.polato@mongodb.com', 'username': 'ppolato'}

Message: SERVER-60550 use getStatusFromWriteCommandReply() in migration_util.cpp

(cherry picked from commit 669a074979de6286f82d39a70b1070a932aa7f76)
Branch: v5.1
https://github.com/mongodb/mongo/commit/34f68f9e7580148afd3f34e4216e091c1891e86e

Comment by Githook User [ 18/Oct/21 ]

Author:

{'name': 'Paolo Polato', 'email': 'paolo.polato@mongodb.com', 'username': 'ppolato'}

Message: SERVER-60550 use getStatusFromWriteCommandReply() in migration_util.cpp

(cherry picked from commit 669a074979de6286f82d39a70b1070a932aa7f76)
Branch: v5.0
https://github.com/mongodb/mongo/commit/ea2f08cf133bddd8f5f8e861dbb5ab2e006aea11

Comment by Githook User [ 14/Oct/21 ]

Author:

{'name': 'Paolo Polato', 'email': 'paolo.polato@mongodb.com', 'username': 'ppolato'}

Message: SERVER-60550 use getStatusFromWriteCommandReply() in migration_util.cpp
Branch: master
https://github.com/mongodb/mongo/commit/669a074979de6286f82d39a70b1070a932aa7f76

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