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

Mongodb Database corrupted on Windows 10

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • ALL

      Problem Description

      We have found that after unexpected MongoDB service shutdown, the database is getting corrupted and it happens randomly

      MongoDB Version 4.0.4 2008R2Plus

      OS: Windows 10

      After logging data for a couple of days we are getting data corruption issues. This is resulting in data loss for us.

      Error in log file:

      2021-05-11T12:27:48.920+0530 I CONTROL [main] Trying to start Windows service 'MongoDB'
      2021-05-11T12:27:49.577+0530 I CONTROL [initandlisten] MongoDB starting : pid=4064 port=27017 dbpath=D:\ItantaDB 64-bit host=ESOS-2
      2021-05-11T12:27:49.578+0530 I CONTROL [initandlisten] targetMinOS: Windows 7/Windows Server 2008 R2
      2021-05-11T12:27:49.578+0530 I CONTROL [initandlisten] db version v4.0.4
      2021-05-11T12:27:49.578+0530 I CONTROL [initandlisten] git version: f288a3bdf201007f3693c58e140056adf8b04839
      2021-05-11T12:27:49.578+0530 I CONTROL [initandlisten] allocator: tcmalloc
      2021-05-11T12:27:49.578+0530 I CONTROL [initandlisten] modules: none
      2021-05-11T12:27:49.578+0530 I CONTROL [initandlisten] build environment:
      2021-05-11T12:27:51.394+0530 I CONTROL [initandlisten] distmod: 2008plus-ssl
      2021-05-11T12:27:51.394+0530 I CONTROL [initandlisten] distarch: x86_64
      2021-05-11T12:27:51.394+0530 I CONTROL [initandlisten] target_arch: x86_64
      2021-05-11T12:27:51.394+0530 I CONTROL [initandlisten] options: { net: { bindIpAll: true }, security: { authorization: "enabled" }, service: true, storage: { dbPath: "D:\ItantaDB", wiredTiger: { engineConfig: { cacheSizeGB: 1.0 } } }, systemLog: { destination: "file", path: "C:\ProgramData\ItantaAnalytics\mongodb.log" } }
      2021-05-11T12:27:51.765+0530 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=1024M,session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),statistics_log=(wait=0),verbose=(recovery_progress),
      2021-05-11T12:27:54.334+0530 I STORAGE [initandlisten] WiredTiger message [1620716274:334351][4064:140735794009424], txn-recover: Main recovery loop: starting at 39/36112640 to 40/256
      2021-05-11T12:27:54.436+0530 I STORAGE [initandlisten] WiredTiger message [1620716274:435293][4064:140735794009424], txn-recover: Recovering log 39 through 40
      2021-05-11T12:27:54.644+0530 I STORAGE [initandlisten] WiredTiger message [1620716274:644163][4064:140735794009424], txn-recover: Recovering log 40 through 40
      2021-05-11T12:27:54.706+0530 I STORAGE [initandlisten] WiredTiger message [1620716274:706126][4064:140735794009424], txn-recover: Set global recovery timestamp: 0
      2021-05-11T12:27:55.782+0530 I RECOVERY [initandlisten] WiredTiger recoveryTimestamp. Ts: Timestamp(0, 0)
      2021-05-11T12:27:56.769+0530 E STORAGE [initandlisten] WiredTiger error (2) [1620716276:740127][4064:140735794009424], file:collection-107--7568313936654431168.wt, WT_SESSION.open_cursor: __win_open_file, 565: D:\ItantaDB\collection-107--7568313936654431168.wt: handle-open: CreateFileW: The system cannot find the file specified.
      : No such file or directory Raw: [1620716276:740127][4064:140735794009424], file:collection-107--7568313936654431168.wt, WT_SESSION.open_cursor: __win_open_file, 565: D:\ItantaDB\collection-107--7568313936654431168.wt: handle-open: CreateFileW: The system cannot find the file specified.
      : No such file or directory
      2021-05-11T12:27:56.769+0530 E STORAGE [initandlisten] Failed to open a WiredTiger cursor: table:collection-107--7568313936654431168
      ~2021-05-11T12:27:56.769+0530 E STORAGE [initandlisten] This may be due to data corruption. Please read the documentation for starting MongoDB with --repair here: http://dochub.mongodb.org/core/repair~
      2021-05-11T12:27:56.769+0530 F - [initandlisten] Fatal Assertion 50882 at src\mongo\db\storage\wiredtiger\wiredtiger_session_cache.cpp 137
      2021-05-11T12:27:56.769+0530 F - [initandlisten]

      ***aborting after fassert() failure

       

       

      Additional Notes

      We tried to repair the data using repair command. After repair, we are able to access the MongoDB. 

      We have uploaded diagnostic data on Google Drive. Location: https://drive.google.com/file/d/1aMnqwqXSAUhiGbvALLboIXJFr3-jXt_-/view?usp=sharing 

      Additional MongoDB service logs are added in attachment section.

      We would like to know the reason why this issue might occurs and Is there any thing which we are missing in configuration ?

      Regards,

      Nandkishor

        1. mongodb.log.2021-05-03T15-11-20
          1004 kB
        2. mongodb.log.2021-05-03T15-57-03
          68 kB
        3. mongodb.log.2021-05-03T19-29-50
          794 kB
        4. mongodb.log.2021-05-11T06-57-46
          6.42 MB
        5. mongodb.log.2021-05-11T07-00-55
          4 kB
        6. mongodb.log.2021-05-11T07-01-48
          4 kB

            Assignee:
            eric.sedor@mongodb.com Eric Sedor
            Reporter:
            ndchavan4289@gmail.com Nandkishor Chavan
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: