[SERVER-53848] Fix undefined object exception in test: timestamped_reads_wait_for_prepare_oplog_visibility.js Created: 16/Jan/21  Updated: 19/Jan/21  Resolved: 19/Jan/21

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

Type: Task Priority: Minor - P4
Reporter: Moustafa Maher Assignee: Moustafa Maher
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Sprint: Repl 2021-01-25
Participants:

 Description   

Code Crashed at that line: https://github.com/mongodb/mongo/blame/master/jstests/core/txns/timestamped_reads_wait_for_prepare_oplog_visibility.js#L62

 With Exception: uncaught exception: TypeError: obj is undefined :

 

That obj is the Json object of the logs["attr"]["command"], which logically it shouldn't ever be undefined as they only looking at logs that has ID = 51803 which is the ID for slow query which always has command field.

But the way they get the Logs is through running getLog command which has a constraint on the length of a single event of 1024 characters https://docs.mongodb.com/manual/reference/command/getLog/#line-truncation

 

looking at our logs, it can easily be more than that length which will be truncated which in some cases will make that line fail with this error.

For now we will fix this test with checking the obj first if it isn't undefined



 Comments   
Comment by Moustafa Maher [ 19/Jan/21 ]

A proper fix will be done in SERVER-53849

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