Affected version: 26.4.2 (confirmed still present in 26.5.1)
Component: com.arcadedb.engine.TransactionManager
Summary
cleanWALFiles(dropFiles=false, force=false) ignores pendingPagesToFlush,
and the close path then unconditionally rm-s every .wal file. Data pages
are never fsynced on the shutdown path.
Code
engine/com/arcadedb/engine/TransactionManager.java:126–150, 614–638
if (force || !dropFiles || file.getPendingPagesToFlush() == 0) { // !dropFiles always wins
if (dropFiles) file.drop(); else file.close();
it.remove();
}
…
File[] walFiles = dir.listFiles((d, n) -> n.endsWith(".wal"));
Stream.of(walFiles).forEach(File::delete); // always
Impact
A clean JVM exit followed by an OS crash / power loss can permanently lose
committed transactions: data pages were write()-ed but not force()-ed,
and the WAL has been deleted.
Suggested fix
Before deleting WAL files in close(false), fsync every
PaginatedComponentFile (channel.force(true)). Alternatively, do not delete
WAL on close(false) — leave them and let the next open replay them (replay
is idempotent).
Affected version: 26.4.2 (confirmed still present in 26.5.1)
Component:
com.arcadedb.engine.TransactionManagerSummary
cleanWALFiles(dropFiles=false, force=false)ignorespendingPagesToFlush,and the close path then unconditionally
rm-s every.walfile. Data pagesare never fsynced on the shutdown path.
Code
engine/com/arcadedb/engine/TransactionManager.java:126–150, 614–638Impact
A clean JVM exit followed by an OS crash / power loss can permanently lose
committed transactions: data pages were
write()-ed but notforce()-ed,and the WAL has been deleted.
Suggested fix
Before deleting WAL files in
close(false), fsync everyPaginatedComponentFile(channel.force(true)). Alternatively, do not deleteWAL on
close(false)— leave them and let the next open replay them (replayis idempotent).