From 3681d537660b5e333c5072f554dc9c23c87b8c89 Mon Sep 17 00:00:00 2001 From: Jesse Gorzinski Date: Wed, 14 Oct 2020 12:11:43 -0500 Subject: [PATCH 1/2] Disable directory fsync on AIX --- lib/storage.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/storage.js b/lib/storage.js index 128f9cc0..d141d758 100755 --- a/lib/storage.js +++ b/lib/storage.js @@ -51,9 +51,9 @@ storage.flushToStorage = function (options, callback) { flags = options.isDir ? 'r' : 'r+'; } - // Windows can't fsync (FlushFileBuffers) directories. We can live with this as it cannot cause 100% dataloss + // Windows/AIX can't fsync (FlushFileBuffers) directories. We can live with this as it cannot cause 100% dataloss // except in the very rare event of the first time database is loaded and a crash happens - if (flags === 'r' && (process.platform === 'win32' || process.platform === 'win64')) { return callback(null); } + if (flags === 'r' && (process.platform === 'win32' || process.platform === 'win64' || process.platform === 'aix')) { return callback(null); } fs.open(filename, flags, function (err, fd) { if (err) { return callback(err); } From c0f306a11974b790e13ba6625c7a77eafda08078 Mon Sep 17 00:00:00 2001 From: Jesse Gorzinski <17914061+ThePrez@users.noreply.github.com> Date: Tue, 7 Mar 2023 14:40:59 -0600 Subject: [PATCH 2/2] Also account for `os400` --- lib/storage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/storage.js b/lib/storage.js index d141d758..b646cbc5 100755 --- a/lib/storage.js +++ b/lib/storage.js @@ -53,7 +53,7 @@ storage.flushToStorage = function (options, callback) { // Windows/AIX can't fsync (FlushFileBuffers) directories. We can live with this as it cannot cause 100% dataloss // except in the very rare event of the first time database is loaded and a crash happens - if (flags === 'r' && (process.platform === 'win32' || process.platform === 'win64' || process.platform === 'aix')) { return callback(null); } + if (flags === 'r' && (process.platform === 'win32' || process.platform === 'win64' || process.platform === 'aix' || process.platform === 'os400')) { return callback(null); } fs.open(filename, flags, function (err, fd) { if (err) { return callback(err); }