Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-4575

Use wt_err instead of wt_errx for corruption messages

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • WT3.2.0, 4.1.11
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • 3
    • Storage Engines 2019-04-22

      In log/log.c__wt_log_scan and btree/bt_handle.c:__wt_btree_tree_open on an error, we try to give the user a helpful message. Those messages use wt_errx. Both files only print those messages when an error has occurred, so ret is known to be non-zero and both have already called wt_err with the return value and printed an initial message.

      This can lead to some confusion in reading MongoDB logs and MongoDB does have different code paths based on whether or not the error value in the error handler is zero or non-zero. When reading the logs we see one message with an error number and then three messages with an error of 0. That can lead someone to believe the error was lost, overwritten or something.

      Both wt_errx and wt_err call the exact same lower function, just with 0 or the given error value respectively. Both WiredTiger functions noted should use wt_err instead and continue to provide same ret to those messages so that the error handling callback and the log messages that result continue to show the same error.

            Assignee:
            alex.cameron@mongodb.com Alex Cameron (Inactive)
            Reporter:
            sue.loverso@mongodb.com Susan LoVerso
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: