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

Enable WiredTiger debug write-ahead logging in MongoDB debug builds

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.2.0-rc3, 4.3.1
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • v4.2
    • Execution Team 2019-06-03, Execution Team 2019-06-17
    • 0

      WT-4712 added some server-wide debugging extensions to the WiredTiger storage engine that can be accessed using the debug_mode configuration option.

      It would be useful, for diagnostic purposes, to enable these extensions in a debug build.

      When enabled, additional debugging information will be present in the wt printlog output. The following command line works for a default MongoDB configuration for a single-node replica set:

      ./wt -C "log=(path=journal,compressor=snappy)" -h /data/db/ printlog > printlog.json
      

      Some of the new debugging entries have a

      {fileid}

      field with the most significant bit set (eg. "fileid": 2147483651 0x8000nnnn):

       "lsn" : [1,6528],
          "hdr_flags" : "compressed",
          "rec_len" : 1920,
          "mem_len" : 3085,
          "type" : "commit",
          "txnid" : 8, 
          "ops": [
            { "optype": "row_put",
              "fileid": 2147483651 0x80000003,
              "key": "\u0081",
              "value": "\u00c9\u0000\u0000\u0000\u0002ns\u0000\u0012\u0000\u0000\u0000local.startup_log\u0000\u0002ident\u0000\"\u0000\u0000\u0000collection-0--1479636524128251023\u0000\u0003md\u0000y\u0000\u0000\u0000\u0002ns\u0000\u0012\u0000\u0000\u0000local.startup_log\u0000\u0003options\u00003\u0000\u0000\u0000\u0005uuid\u0000\u0010\u0000\u0000\u0000\u0004\u0081\u00db\u001dO\u001c\u00b3E*\u00b2)\u00b2+\u0019\u008d\u008a\t\u0008capped\u0000\u0001\u0010size\u0000\u0000\u0000\u00a0\u0000\u0000\u0004indexes\u0000\u0005\u0000\u0000\u0000\u0000\u0012prefix\u0000\u00ff\u00ff\u00ff\u00ff\u00ff\u00ff\u00ff\u00ff\u0000\u0000"
            },   
            { "optype": "row_put",
              "fileid": 2147483651 0x80000003,
      ...
      

      Additional debugging entries may also contain a txn_timestamp field:

        { "lsn" : [1,25472],
          "hdr_flags" : "compressed",
          "rec_len" : 1024,
          "mem_len" : 1915,
          "type" : "commit",
          "txnid" : 44,
          "ops": [
            { "optype": "row_put",
              "fileid": 2147483651 0x80000003,
              "key": "\u0087",
              "value": "\u00bc\u0000\u0000\u0000\u0002ns\u0000\u0015\u0000\u0000\u0000local.system.replset\u0000\u0002ident\u0000\"\u0000\u0000\u0000collection-9--1479636524128251023\u0000\u0003md\u0000i\u0000\u0000\u0000\u0002ns\u0000\u0015\u0000\u0000\u0000local.system.replset\u0000\u0003options\u0000 \u0000\u0000\u0000\u0005uuid\u0000\u0010\u0000\u0000\u0000\u0004\u00c4\u00e91\u00db\u00ce\u00caA\u00d5\u0090\u0096\r\u008c\u00fc\u0095\u00ef\u00ce\u0000\u0004indexes\u0000\u0005\u0000\u0000\u0000\u0000\u0012prefix\u0000\u00ff\u00ff\u00ff\u00ff\u00ff\u00ff\u00ff\u00ff\u0000\u0000"
            },   
      ...
            { "optype": "txn_timestamp",
              "time_sec": 1559748447,
              "time_nsec": 167604000,
              "commit_ts": 6699068569851789313,
              "durable_ts": 0,
              "first_ts": 6699068569851789313,
              "prepare_ts": 0,
              "read_ts": 0
            },
      ...
      

            Assignee:
            benety.goh@mongodb.com Benety Goh
            Reporter:
            louis.williams@mongodb.com Louis Williams
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: