[SERVER-16283] Can't start new wiredtiger node with log file or config file in data directory - false detection of old mmapv1 files Created: 22/Nov/14  Updated: 11/Jul/16  Resolved: 24/Nov/14

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: 2.8.0-rc0
Fix Version/s: 2.6.6, 2.8.0-rc2

Type: Bug Priority: Major - P3
Reporter: Cailin Nelson Assignee: Benety Goh
Resolution: Done Votes: 0
Labels: mms, wiredtiger
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
is related to SERVER-15986 Starting with different storage engin... Closed
Tested
Operating System: ALL
Backport Completed:
Participants:

 Description   

Can't get a wiredtiger node to start if the log file is inside the data directory.

ubuntu@ip-10-169-132-210:~$ cat mmsdev4.conf 
net:
  port: 27018
operationProfiling: {}
processManagement:
  fork: "true"
replication:
  replSetName: mmsdev
storage:
  dbPath: /data/mmsdev_4
  engine: wiredtiger
systemLog:
  destination: file
  path: /data/mmsdev_4/mongodb.log
ubuntu@ip-10-169-132-210:~$ sudo -u mongodb mkdir /data/mmsdev_4
ubuntu@ip-10-169-132-210:~$ ls -lta /data/mmsdev_4
total 8
drwxr-xr-x 2 mongodb nogroup 4096 Nov 22 17:27 .
drwxr-xr-x 8 mongodb mongodb 4096 Nov 22 17:27 ..                                            
ubuntu@ip-10-169-132-210:~$ sudo -u mongodb /var/lib/mongodb-mms-automation/mongodb-linux-x86_64-2.8.0-rc1-pre-5/bin/mongod -f mmsdev4.conf 
about to fork child process, waiting until server is ready for connections.
forked process: 2068
ERROR: child process failed, exited with error number 100
ubuntu@ip-10-169-132-210:~$ cat /data/mmsdev_4/mongodb.log 
2014-11-22T17:28:36.625+0000 I CONTROL  [initandlisten] MongoDB starting : pid=2068 port=27018 dbpath=/data/mmsdev_4 64-bit host=ip-10-169-132-210
2014-11-22T17:28:36.626+0000 I CONTROL  [initandlisten] 
2014-11-22T17:28:36.626+0000 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2014-11-22T17:28:36.626+0000 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2014-11-22T17:28:36.626+0000 I CONTROL  [initandlisten] 
2014-11-22T17:28:36.626+0000 I CONTROL  [initandlisten] db version v2.8.0-rc1
2014-11-22T17:28:36.626+0000 I CONTROL  [initandlisten] git version: 609a1492d2895ea55a9202815590636d1934a9ca
2014-11-22T17:28:36.626+0000 I CONTROL  [initandlisten] build info: Linux build14.nj1.10gen.cc 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Jan 3 21:39:27 UTC 2014 x86_64 BOOST_LIB_VERSION=1_49
2014-11-22T17:28:36.626+0000 I CONTROL  [initandlisten] allocator: tcmalloc
2014-11-22T17:28:36.626+0000 I CONTROL  [initandlisten] options: { config: "mmsdev4.conf", net: { port: 27018 }, processManagement: { fork: true }, replication: { replSetName: "mmsdev" }, storage: { dbPath: "/data/mmsdev_4", engine: "wiredtiger" }, systemLog: { destination: "file", path: "/data/mmsdev_4/mongodb.log" } }
2014-11-22T17:28:36.626+0000 I STORAGE  [initandlisten] exception in initAndListen: 28574 Cannot start server. Detected data files in /data/mmsdev_4 created by storage engine 'mmapv1'. The configured storage engine is 'wiredTiger'., terminating
2014-11-22T17:28:36.626+0000 I COMMAND  [initandlisten] dbexit:  rc: 100

If I change the log directory, everything is fine:

ubuntu@ip-10-169-132-210:~$ sudo -u mongodb mkdir /data/mmsdev_4
ubuntu@ip-10-169-132-210:~$ ls -lta /data/mmsdev_4
total 8
drwxr-xr-x 2 mongodb nogroup 4096 Nov 22 17:35 .
drwxr-xr-x 8 mongodb mongodb 4096 Nov 22 17:35 ..
ubuntu@ip-10-169-132-210:~$ 
ubuntu@ip-10-169-132-210:~$ cat mmsdev4.conf 
net:
  port: 27018
operationProfiling: {}
processManagement:
  fork: "true"
replication:
  replSetName: mmsdev
storage:
  dbPath: /data/mmsdev_4
  engine: wiredtiger
systemLog:
  destination: file
  path: /tmp/mongodb.log
ubuntu@ip-10-169-132-210:~$ sudo -u mongodb /var/lib/mongodb-mms-automation/mongodb-linux-x86_64-2.8.0-rc1-pre-5/bin/mongod -f mmsdev4.conf 
about to fork child process, waiting until server is ready for connections.
forked process: 3169
child process started successfully, parent exiting
ubuntu@ip-10-169-132-210:~$ head -n20 /tmp/mongodb.log
2014-11-22T17:36:07.828+0000 I CONTROL  [initandlisten] MongoDB starting : pid=3169 port=27018 dbpath=/data/mmsdev_4 64-bit host=ip-10-169-132-210
2014-11-22T17:36:07.828+0000 I CONTROL  [initandlisten] 
2014-11-22T17:36:07.828+0000 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2014-11-22T17:36:07.828+0000 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2014-11-22T17:36:07.828+0000 I CONTROL  [initandlisten] 
2014-11-22T17:36:07.828+0000 I CONTROL  [initandlisten] db version v2.8.0-rc1
2014-11-22T17:36:07.828+0000 I CONTROL  [initandlisten] git version: 609a1492d2895ea55a9202815590636d1934a9ca
2014-11-22T17:36:07.828+0000 I CONTROL  [initandlisten] build info: Linux build14.nj1.10gen.cc 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Jan 3 21:39:27 UTC 2014 x86_64 BOOST_LIB_VERSION=1_49
2014-11-22T17:36:07.828+0000 I CONTROL  [initandlisten] allocator: tcmalloc
2014-11-22T17:36:07.828+0000 I CONTROL  [initandlisten] options: { config: "mmsdev4.conf", net: { port: 27018 }, processManagement: { fork: true }, replication: { replSetName: "mmsdev" }, storage: { dbPath: "/data/mmsdev_4", engine: "wiredtiger" }, systemLog: { destination: "file", path: "/tmp/mongodb.log" } }
2014-11-22T17:36:07.828+0000 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=3G,session_max=20000,extensions=[local=(entry=index_collator_extension)],statistics=(all),log=(enabled=true,archive=true,path=journal),checkpoint=(wait=60,log_size=2GB),
2014-11-22T17:36:07.856+0000 I REPL     [initandlisten] Did not find local replica set configuration document at startup;  NoMatchingDocument Did not find replica set configuration document in local.system.replset
2014-11-22T17:36:07.862+0000 I NETWORK  [initandlisten] waiting for connections on port 27018
2014-11-22T17:36:07.943+0000 I NETWORK  [initandlisten] connection accepted from 10.169.132.210:40628 #1 (1 connection now open)
2014-11-22T17:36:07.952+0000 I REPL     [WriteReplSetConfig] Starting replication applier threads
2014-11-22T17:36:07.952+0000 I REPL     [rsSync] replSet warning did not receive a valid config yet, sleeping 5 seconds 
2014-11-22T17:36:07.952+0000 I REPL     [ReplicationExecutor] transition to STARTUP2
2014-11-22T17:36:07.952+0000 I REPL     [ReplicationExecutor] Member ip-10-169-132-210.ec2.internal:27017 is now in state ARBITER
2014-11-22T17:36:07.953+0000 I REPL     [ReplicationExecutor] Member ip-10-218-181-240.ec2.internal:27017 is now in state PRIMARY
2014-11-22T17:36:07.954+0000 I REPL     [ReplicationExecutor] Member ip-10-167-150-115.ec2.internal:27017 is now in state SECONDARY



 Comments   
Comment by Githook User [ 24/Nov/14 ]

Author:

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

Message: SERVER-15986 SERVER-16283 prevent server from starting up when non-active storage engine files are detected
Branch: v2.6
https://github.com/mongodb/mongo/commit/24037e138350ca04e2484468978f58355bf1bb96

Comment by Githook User [ 24/Nov/14 ]

Author:

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

Message: SERVER-15986 SERVER-16283 improve validation to detect mmapv1 local.ns files

(cherry picked from commit bb8e5e6b28f31a0b4e9eefc5df52581073bf332d)
Branch: v2.6
https://github.com/mongodb/mongo/commit/741abbe02d6d0b6eb1334cc66458393363f30833

Comment by Githook User [ 24/Nov/14 ]

Author:

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

Message: SERVER-15986 SERVER-16283 enable storage engine check
Branch: master
https://github.com/mongodb/mongo/commit/8971aede7a00d0918645cb4fb0e579f153d737df

Comment by Githook User [ 24/Nov/14 ]

Author:

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

Message: SERVER-15986 SERVER-16283 improve validation to detect mmapv1 local.ns files
Branch: master
https://github.com/mongodb/mongo/commit/bb8e5e6b28f31a0b4e9eefc5df52581073bf332d

Comment by Cailin Nelson [ 22/Nov/14 ]

This is also true if you try to place the MongoDB configuration file inside the data directory.

Generated at Thu Feb 08 03:40:34 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.