diff options
Diffstat (limited to 'jstests/watchdog/wd_journal_hang.js')
-rw-r--r-- | jstests/watchdog/wd_journal_hang.js | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/jstests/watchdog/wd_journal_hang.js b/jstests/watchdog/wd_journal_hang.js new file mode 100644 index 00000000000..c07b4298170 --- /dev/null +++ b/jstests/watchdog/wd_journal_hang.js @@ -0,0 +1,33 @@ +// Storage Node Watchdog - validate watchdog monitors --dbpath /journal +// @tags: [requires_wiredtiger,requires_journaling] +// +load("jstests/watchdog/lib/wd_test_common.js"); + +(function() { + 'use strict'; + + function trimTrailingSlash(dir) { + if (dir.endsWith('/')) { + return dir.substring(0, dir.length - 1); + } + + return dir; + } + + let control = new CharybdefsControl("journalpath_hang"); + + const journalFusePath = control.getMountPath(); + + const dbPath = MongoRunner.toRealDir("$dataDir/mongod-journal"); + + const journalLinkPath = dbPath + "/journal"; + + resetDbpath(dbPath); + + // Create a symlink from the non-fuse journal directory to the fuse mount. + const ret = run("ln", "-s", trimTrailingSlash(journalFusePath), journalLinkPath); + assert.eq(ret, 0); + + // Set noCleanData so that the dbPath is not cleaned because we want to use the journal symlink. + testFuseAndMongoD(control, {dbpath: dbPath, noCleanData: true}); +})(); |