From 6fbf1cfffff3186fa5e5e56c0f446a3504bbeab5 Mon Sep 17 00:00:00 2001 From: Ruslan Cheremin Date: Fri, 26 Sep 2025 16:10:33 +0200 Subject: [PATCH] [vfs] re-create content storage index map in any doubts + if content storage was not closed properly, or recovery was needed -- always re-create and rebuild record's index map, to avoid any inconsistencies GitOrigin-RevId: d448f13c9c72ee50593c82b4a31e8089326c301f --- .../mapped/content/VFSContentStorageOverMMappedFile.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/mapped/content/VFSContentStorageOverMMappedFile.java b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/mapped/content/VFSContentStorageOverMMappedFile.java index 2ec58d968780..284780865f91 100644 --- a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/mapped/content/VFSContentStorageOverMMappedFile.java +++ b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/mapped/content/VFSContentStorageOverMMappedFile.java @@ -153,7 +153,9 @@ public class VFSContentStorageOverMMappedFile implements VFSContentStorage, Unma .open(storagePath); Path mapPath = storagePath.resolveSibling(storagePath.getFileName().toString() + ".hashToId"); - if (contentStorage.isEmpty()) { + if (contentStorage.isEmpty() + || !contentStorage.wasClosedProperly() + || contentStorage.wasRecoveryNeeded()) { //ensure map is also empty NioFiles.deleteRecursively(mapPath); }