[SERVER-40294] jstests/sharding/txn_read_only_transactions.js should look for logged lines in a loop Created: 22/Mar/19  Updated: 29/Oct/23  Resolved: 22/Mar/19

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

Type: Bug Priority: Major - P3
Reporter: Jack Mulrow Assignee: Jack Mulrow
Resolution: Fixed Votes: 0
Labels: sharding-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding 2019-04-08
Participants:
Linked BF Score: 32

 Description   

jstests/sharding/txn_read_only_transactions.js tests read only transactions by running commitTransaction commands and asserting certain lines are logged by mongos to determine the correct version of commit was used, i.e. a read-only commit vs. a two-phase commit. It does so by searching for the expected log in the shell's rawMongoProgramOutput after running the commits.

Although the commits must have finished by this point, it is not guaranteed the lines logged by mongos during commit have reached the shell's rawMongoProgramOutput, in which case the test fails (verified by adding sleeps in ProgramOutputMultiplexer::appendLine when the line to add is one of those the test is looking for).

The simplest fix for this is to perform the search for logs in a loop, since in normal operation the lines should reach rawMongoProgramOutput eventually.



 Comments   
Comment by Githook User [ 22/Mar/19 ]

Author:

{'email': 'jack.mulrow@mongodb.com', 'name': 'Jack Mulrow', 'username': 'jsmulrow'}

Message: SERVER-40294 txn_read_only_transactions.js should look for logged lines in a loop
Branch: master
https://github.com/mongodb/mongo/commit/dc747812eec3cff55b8a94d34eea80a97bbb8b6f

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