IJPL-179600 do not mark db file on disk as modified if no data changes

GitOrigin-RevId: 261fd5765377d7fedd661fb8329237e246453d9c
This commit is contained in:
Vladimir Krivosheev
2025-05-02 09:53:13 +00:00
committed by intellij-monorepo-bot
parent 0e61dfb15c
commit 0b9cd73509
@@ -201,8 +201,15 @@ internal class BazelPersistentMapletFactory private constructor(
override fun close() {
// during save, we enumerate strings, so we cannot save as a part of close,
// as in this case string enumerator maps maybe not saved (as being closed)
store.commit()
store.close()
if (store.hasUnsavedChanges()) {
store.commit()
store.close()
}
else {
// even if no changes, MvStore update file header -
// we want to avoid unnecessary disk writes and file on disk with an updated "modified timestamp"
store.closeImmediately()
}
}
fun forceClose() {