[SERVER-48571] Write operation might invariant if a target error and a response error is received Created: 03/Jun/20  Updated: 29/Oct/23  Resolved: 06/Nov/20

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

Type: Bug Priority: Major - P3
Reporter: Marcos José Grillo Ramirez Assignee: Marcos José Grillo Ramirez
Resolution: Fixed Votes: 0
Labels: sharding-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Problem/Incident
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.4
Sprint: Sharding 2020-08-24, Sharding 2020-09-21, Sharding 2020-10-05, Sharding 2020-10-19, Sharding 2020-11-02, Sharding 2020-11-16
Participants:
Linked BF Score: 8

 Description   

Supose we have a sharded cluster with 2 shards: shard0 and shard1 and one router: router0. If router0 losses communication with the primary of shard0 (causing a targeting error) and a transaction with a multi-write operation comes in, then this condition will change the write op state to ERROR, which will conflict with the second shard response, because the entire operation should be canceled (a failure when trying an operation within a transaction should cancel the entire operation), causing this invariant to hit. On the depended BF we can see such situation, and even though the reproduction steps involves a RSM failure and a crash on wireTiger, we could develop an unittest to check and correct this behaviour.



 Comments   
Comment by Githook User [ 20/Nov/20 ]

Author:

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

Message: SERVER-48571 Fix invariant on batch write executor by: * Change early return logic under a transaction if a targeter error occurred * Execute baton manually to ensure unittest termination

(cherry picked from commit 27b21be87be6ca754f2c8591e7cbd71992982c4f)
(cherry picked from commit 74648046a74da68b167fbf43742f9d702b5c282d)
Branch: v4.4
https://github.com/mongodb/mongo/commit/4c9f3f84cff93c993bcea5bb43c67aeafb93a1ac

Comment by Githook User [ 07/Nov/20 ]

Author:

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

Message: SERVER-48571 Execute baton manually to ensure unittest termination
Branch: master
https://github.com/mongodb/mongo/commit/74648046a74da68b167fbf43742f9d702b5c282d

Comment by Githook User [ 06/Nov/20 ]

Author:

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

Message: SERVER-48571 Write operation might invariant if a target error happens and a response error is received under a transaction
Branch: master
https://github.com/mongodb/mongo/commit/27b21be87be6ca754f2c8591e7cbd71992982c4f

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