[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
This commit is contained in:
Ruslan Cheremin
2025-09-26 18:13:17 +00:00
committed by intellij-monorepo-bot
parent 30ef0f556f
commit 6fbf1cffff
@@ -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);
}