Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-53848

Fix undefined object exception in test: timestamped_reads_wait_for_prepare_oplog_visibility.js

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Won't Fix
    • Icon: Minor - P4 Minor - P4
    • None
    • None
    • None
    • None
    • Repl 2021-01-25

    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

      Attachments

        Activity

          People

            m.maher@mongodb.com Moustafa Maher
            m.maher@mongodb.com Moustafa Maher
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: