Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.OutputStream;
import java.nio.file.DirectoryNotEmptyException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
Expand Down Expand Up @@ -412,6 +413,20 @@ public void removeCacheGroupConfigurationData(CacheGroupContext ctx) throws Igni
throw new IgniteCheckedException("Failed to delete cache configurations of group: " + ctx);
}
}

// Remove leftover (now empty) cache storage directories so that PDS is not cluttered with empty
// directories after cache group destroy, see IGNITE-13989. Non-empty directories are left untouched.
for (File dir : ft.cacheStorages(ctx.config())) {
try {
Files.deleteIfExists(dir.toPath());
}
catch (DirectoryNotEmptyException e) {
log.warning("Cache storage directory is not empty and cannot be removed: " + dir.getAbsolutePath());
}
catch (IOException e) {
log.warning("Failed to remove cache storage directory [dir=" + dir.getAbsolutePath() + ']', e);
}
}
}

/**
Expand Down
Loading
Loading