[SERVER-55174] Investigate test failure in sharded_collections_causally_consistent_jscore_txns_passthrough suite with db.currentOp change Created: 12/Mar/21  Updated: 27/Oct/23  Resolved: 07/May/21

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

Type: Improvement Priority: Major - P3
Reporter: Katherine Wu (Inactive) Assignee: Backlog - Query Optimization
Resolution: Gone away Votes: 0
Labels: quick-tech-debt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-47603 Rewrite db.currentOp() shell helper i... Closed
Assigned Teams:
Query Optimization
Participants:

 Description   

After changes db.currentOp introduced in SERVER-47603 the jstests/core/txns/write_conflicts_with_non_txns.js test fails in the sharded_collections_causally_consistent_jscore_txns_passthrough suite. Investigate the cause of this failure so that we can remove this test from the excluded files of the passthrough suite.



 Comments   
Comment by James Wahlin [ 26/Mar/21 ]

I suspect this issue is due to a clash between db.currentOp() readConcern override and the readConcern overrides put in place by our causal consistency suites. This can be fixed by changing the db.currentOp() invocation to an aggregate command. The following patch (based on commit d5ec2876050089857832308a5f72ea23dbb49715) allows this test to pass:

diff --git a/jstests/core/txns/write_conflicts_with_non_txns.js b/jstests/core/txns/write_conflicts_with_non_txns.js
index aeafbc870c..0c2558dbc2 100644
--- a/jstests/core/txns/write_conflicts_with_non_txns.js
+++ b/jstests/core/txns/write_conflicts_with_non_txns.js
@@ -58,7 +58,8 @@ function singleDocWrite(dbName, collName, doc) {
 
 // Returns true if a single document insert has started running on the server.
 function writeStarted() {
-    return testDB.currentOp().inprog.some(op => {
+    return testDB.getSiblingDB("admin").aggregate([{$currentOp: {allUsers: false}}]).toArray().some(op => {
+        jsTest.log(op);
         return op.active && (op.ns === testColl.getFullName()) && (op.op === "insert") &&
             (op.writeConflicts > 0);
     });

Please note that there is currently discussion underway as to whether we will need to revert SERVER-47603. If we do revert then this failure will go away.

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