[SERVER-41255] Enable WiredTiger debug write-ahead logging in MongoDB debug builds Created: 21/May/19  Updated: 29/Oct/23  Resolved: 10/Jun/19

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.2.0-rc3, 4.3.1

Type: Improvement Priority: Major - P3
Reporter: Louis Williams Assignee: Benety Goh
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
depends on WT-4712 Add debug log op record for non-logge... Closed
Duplicate
is duplicated by SERVER-41254 Turn on write-ahead logging for hybri... Closed
Problem/Incident
Related
is related to SERVER-41227 Update multiversion tests following 4... Closed
Backwards Compatibility: Fully Compatible
Backport Requested:
v4.2
Sprint: Execution Team 2019-06-03, Execution Team 2019-06-17
Participants:
Linked BF Score: 0

 Description   

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
      },
...



 Comments   
Comment by Githook User [ 05/Jul/19 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: SERVER-41255 enable debug write-ahead logging for all WT tables under debug build

(cherry picked from commit c909ba6087c4ed434513e4d39d310a4969d0c070)
Branch: v4.2
https://github.com/mongodb/mongo/commit/3a446772adac78d516cf3a86ec8d60ec4004ee71

Comment by Githook User [ 10/Jun/19 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: SERVER-41255 enable debug write-ahead logging for all WT tables under debug build
Branch: master
https://github.com/mongodb/mongo/commit/c909ba6087c4ed434513e4d39d310a4969d0c070

Comment by Benety Goh [ 07/Jun/19 ]

This test current fails with the following jstests/multiVersion tests with references to the 4.0 binary:

  • downgrade_after_rollback_via_refetch.js
  • drop_collection_downgrade_path.js

We can re-commit this patch after SERVER-41227 is completed.

Comment by Githook User [ 07/Jun/19 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: Revert "SERVER-41255 enable debug write-ahead logging for all WT tables under debug build"

This reverts commit 43c32fbc1d17fd050f179d5657de0113c8266994.
Branch: master
https://github.com/mongodb/mongo/commit/7a86bc47c91eaf8fc198f2949aeb7201516801fe

Comment by Githook User [ 05/Jun/19 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: SERVER-41255 enable debug write-ahead logging for all WT tables under debug build
Branch: master
https://github.com/mongodb/mongo/commit/43c32fbc1d17fd050f179d5657de0113c8266994

Generated at Thu Feb 08 04:57:14 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.