[SERVER-51058] log_remote_op_wait.js misuses rawMongoProgramOutput Created: 18/Sep/20  Updated: 29/Oct/23  Resolved: 23/Oct/20

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

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

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:
Linked BF Score: 15

 Description   

On the v4.2 branch, log_remote_op_wait.js uses the rawMongoProgramOutput() function to assert that a query produces the right log line. But rawMongoProgramOutput() doesn't necessarily include the log line, even though the server did write it, and the client did receive the response. The problem is that the command response and the log line happen over two different channels (the network, vs a background thread reading from a pipe).

It looks like other jstests fix this by shutting down the server before checking rawMongoProgramOutput(); that should work here too.

This only affects the v4.2 branch. Originally log_remote_op_wait.js used the getLog command, but when backporting the test to 4.2 we switched one assertion to rawMongoProgramOutput to overcome the log-line length limit of getLog.



 Comments   
Comment by Githook User [ 09/Oct/20 ]

Author:

{'name': 'David Percy', 'email': 'david.percy@mongodb.com', 'username': 'dpercy'}

Message: SERVER-51058 Use rawMongoProgramOutput carefully in log_remote_op_wait.js

On the v4.2 branch, log_remote_op_wait.js uses the rawMongoProgramOutput()
function to assert that a query produces the right log line. But
rawMongoProgramOutput() doesn't necessarily include the log line,
even though the server did write it, and the client did receive the
response. The problem is that the command response and the log line
happen over two different channels (the network, vs a background thread
reading from a pipe).

It looks like other jstests fix this by shutting down the server before
checking rawMongoProgramOutput(); that should work here too.

This only affects the v4.2 branch. Originally log_remote_op_wait.js used
the getLog command, but when backporting the test to 4.2 we switched
one assertion to rawMongoProgramOutput to overcome the log-line length
limit of getLog.
Branch: v4.2
https://github.com/mongodb/mongo/commit/dfb31874bf10e55c39e615ef86290b68ba0f43b3

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