...
If I start MongoDB 3.4.3, wait a few seconds, ctrl-c out, and repeat the journal directory adds a new WiredTigerLog.* file for every restart. i.e. /tmp/foo# ls -alh journal/ total 201M drwxrwxr-x 2 corymintz corymintz 4.0K Apr 5 13:46 . drwxrwxr-x 4 corymintz corymintz 4.0K Apr 5 13:46 .. -rw-rw-r-- 1 corymintz corymintz 23K Apr 5 13:46 WiredTigerLog.0000000001 -rw-rw-r-- 1 corymintz corymintz 6.3K Apr 5 13:46 WiredTigerLog.0000000002 -rw-rw-r-- 1 corymintz corymintz 6.3K Apr 5 13:46 WiredTigerLog.0000000003 -rw-rw-r-- 1 corymintz corymintz 6.3K Apr 5 13:46 WiredTigerLog.0000000004 -rw-rw-r-- 1 corymintz corymintz 6.3K Apr 5 13:46 WiredTigerLog.0000000005 -rw-rw-r-- 1 corymintz corymintz 6.3K Apr 5 13:46 WiredTigerLog.0000000006 -rw-rw-r-- 1 corymintz corymintz 6.3K Apr 5 13:46 WiredTigerLog.0000000007 -rw-rw-r-- 1 corymintz corymintz 100M Apr 5 13:46 WiredTigerPreplog.0000000001 -rw-rw-r-- 1 corymintz corymintz 100M Apr 5 13:46 WiredTigerPreplog.0000000002 Following the exact same procedure with MongoDB 3.4.2, the old files are cleaned up /tmp/foo# ls -alh journal/ total 201M drwxrwxr-x 2 corymintz corymintz 4.0K Apr 5 14:09 . drwxrwxr-x 4 corymintz corymintz 4.0K Apr 5 14:09 .. -rw-rw-r-- 1 corymintz corymintz 4.3K Apr 5 14:09 WiredTigerLog.0000000007 -rw-rw-r-- 1 corymintz corymintz 100M Apr 5 14:09 WiredTigerPreplog.0000000001 -rw-rw-r-- 1 corymintz corymintz 100M Apr 5 14:09 WiredTigerPreplog.0000000002
ramon.fernandez commented on Thu, 14 Sep 2017 23:11:38 +0000: Author: {'username': u'bvpvamsikrishna', 'name': u'Susan LoVerso', 'email': u'sue@mongodb.com'} Message:SERVER-28637 Remove journal files if journaling is toggled off. (cherry picked from commit 7d5b12eac722a0f3a564e0c7f778e525f06b6bf7) Branch:v3.4 https://github.com/mongodb/mongo/commit/0777ec8c479ddab77bd7522a3691b196afda707b xgen-internal-githook commented on Mon, 22 May 2017 16:18:56 +0000: Author: {u'username': u'sueloverso', u'name': u'Susan LoVerso', u'email': u'sue@mongodb.com'} Message: SERVER-28637 Remove journal files if journaling is toggled off. Branch: master https://github.com/mongodb/mongo/commit/7d5b12eac722a0f3a564e0c7f778e525f06b6bf7 sue.loverso commented on Thu, 18 May 2017 19:21:49 +0000: While WT-3264 covers the issue for detecting LSNs and creating the correctly numbered log files, I believe my change proposed here is also needed to avoid constantly toggling the logging setting on restarts. After the first time, we should remove the journalPath. Later restarts won't need to take that conditional then. alexander.gorrod commented on Tue, 2 May 2017 17:19:19 +0000: The changes to implement this change are going to happen at the WiredTiger level, and the work is covered by WT-3264. sue.loverso commented on Wed, 5 Apr 2017 18:39:53 +0000: Yes, we should be able to split out the recovery/archiving so that it archives after a clean shutdown. I have opened WT-3263 for this. alexander.gorrod commented on Wed, 5 Apr 2017 18:32:15 +0000: cory.mintz I believe what you are seeing is a deliberate consequence of WT-3114, in which we stopped archiving (removing) log files on startup. They now only get archived after the first checkpoint. sue.loverso Do you think there is a reasonable path to cleaning up old log files on clean shutdown? I believe that would retain the behavior Cory wants, while still keeping the benefit of WT-3114.