Fix undefined object exception in test: timestamped_reads_wait_for_prepare_oplog_visibility.js

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Won't Fix
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Repl 2021-01-25
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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

            Assignee:
            Moustafa Maher
            Reporter:
            Moustafa Maher
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: