Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-5469

fsyncLock() prevents the mongod process to shut it down with SIGTERM or the shutdown command

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical - P2
    • Resolution: Won't Fix
    • None
    • None
    • manual, Server
    • None

    Description

      There are two behaviours while trying to shutdown a mongod which is fync'd and locked based on it's version:

      2.6 shutdowns only after it's unlocked

      SIGTERM

      2015-05-20T14:06:48.849+0100 [initandlisten] connection accepted from 127.0.0.1:64721 #1 (1 connection now open)
      2015-05-20T14:06:52.969+0100 [conn1] CMD fsync: sync:1 lock:1
      2015-05-20T14:06:52.977+0100 [fsyncLockWorker] removeJournalFiles
      2015-05-20T14:06:52.984+0100 [conn1] db is now locked for snapshotting, no writes allowed. db.fsyncUnlock() to unlock
      2015-05-20T14:06:52.984+0100 [conn1]     For more info see http://dochub.mongodb.org/core/fsynccommand
      // gap
      2015-05-20T14:06:55.960+0100 [signalProcessingThread] got signal 15 (Terminated: 15), will terminate after current cmd ends
      2015-05-20T14:07:01.217+0100 [conn1] command: unlock requested
      2015-05-20T14:07:01.217+0100 [signalProcessingThread] now exiting
      

      shutdown command

      2015-05-20T14:07:53.878+0100 [conn1] CMD fsync: sync:1 lock:1
      2015-05-20T14:07:53.887+0100 [fsyncLockWorker] removeJournalFiles
      2015-05-20T14:07:53.894+0100 [conn1] db is now locked for snapshotting, no writes allowed. db.fsyncUnlock() to unlock
      2015-05-20T14:07:53.894+0100 [conn1]     For more info see http://dochub.mongodb.org/core/fsynccommand
      // gap
      2015-05-20T14:08:26.359+0100 [initandlisten] connection accepted from 127.0.0.1:64882 #2 (2 connections now open)
      2015-05-20T14:08:26.359+0100 [conn2] command: unlock requested
      2015-05-20T14:08:26.359+0100 [conn1] terminating, shutdown command received
      2015-05-20T14:08:26.359+0100 [conn1] dbexit: shutdown called
      2015-05-20T14:08:26.359+0100 [conn1] shutdown: going to close listening sockets...
      2015-05-20T14:08:26.359+0100 [conn1] closing listening socket: 7
      2015-05-20T14:08:26.359+0100 [conn1] closing listening socket: 8
      2015-05-20T14:08:26.359+0100 [conn1] removing socket file: /tmp/mongodb-27017.sock
      2015-05-20T14:08:26.360+0100 [conn1] shutdown: going to flush diaglog...
      2015-05-20T14:08:26.360+0100 [conn1] shutdown: going to close sockets...
      2015-05-20T14:08:26.360+0100 [conn1] shutdown: waiting for fs preallocator...
      2015-05-20T14:08:26.360+0100 [conn1] shutdown: lock for final commit...
      2015-05-20T14:08:26.360+0100 [conn1] shutdown: final commit...
      2015-05-20T14:08:26.360+0100 [conn2] end connection 127.0.0.1:64882 (1 connection now open)
      2015-05-20T14:08:26.368+0100 [conn1] shutdown: closing all files...
      2015-05-20T14:08:26.370+0100 [conn1] closeAllFiles() finished
      2015-05-20T14:08:26.370+0100 [conn1] journalCleanup...
      2015-05-20T14:08:26.370+0100 [conn1] removeJournalFiles
      2015-05-20T14:08:26.370+0100 [conn1] shutdown: removing fs lock...
      2015-05-20T14:08:26.370+0100 [conn1] dbexit: really exiting now
      

      3.0 cannot be shutdown or unlocked after a shutdown command or SIGTERM is sent to the mongod

      The process cannot be killed after the database is locked (SERVER-17589).
      It won't accept further commands (fsyncUnlock()) or SIGTERM.

      2015-05-20T14:50:53.162+0100 I NETWORK  [initandlisten] connection accepted from 127.0.0.1:53261 #1 (1 connection now open)
      2015-05-20T14:50:56.174+0100 I STORAGE  [conn1] CMD fsync: sync:1 lock:1
      2015-05-20T14:50:56.183+0100 I JOURNAL  [fsyncLockWorker] journalCleanup...
      2015-05-20T14:50:56.183+0100 I JOURNAL  [fsyncLockWorker] removeJournalFiles
      2015-05-20T14:50:56.190+0100 I STORAGE  [conn1] db is now locked, no writes allowed. db.fsyncUnlock() to unlock
      2015-05-20T14:50:56.190+0100 I STORAGE  [conn1]     For more info see http://dochub.mongodb.org/core/fsynccommand
      2015-05-20T14:50:58.852+0100 I CONTROL  [signalProcessingThread] got signal 15 (Terminated: 15), will terminate after current cmd ends
      2015-05-20T14:51:02.439+0100 I STORAGE  [conn1] got request after shutdown()
      

      Attachments

        Issue Links

          Activity

            People

              kay.kim@mongodb.com Kay Kim (Inactive)
              gianfranco Gianfranco Palumbo
              Jess Mokrzecki Jess Mokrzecki
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                13 weeks, 6 days ago