[ 
https://issues.apache.org/jira/browse/IGNITE-28843?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18095581#comment-18095581
 ] 

Anton Vinogradov commented on IGNITE-28843:
-------------------------------------------

[Ignite PR Checker|https://ignite-pr-checker.is-a.dev/?pr=13307] verdict for PR 
13307 · RunAll build [9166431|https://ci2.ignite.apache.org/build/9166431] · 
147 suites ran, 0 reused

(!) *15 broken suite(s)* (failed without a reliable run):
- Cache 8: Number of tests 377 is 35% less than 581 in build #40211
- Cache 9: Number of tests 79 is 66% less than 233 in build #39580
- Disk Page Compressions 1: Number of tests 58 is 48% less than 112 in build 
#17159
- SPI (Discovery): Number of tests 279 is 51% less than 570 in build #16891
- Consistency: Number of tests 544 is 43% less than 960 in build #15413
- Snapshots 2: Number of tests 132 is 70% less than 444 in build #10708
- Disk Page Compressions 5: Number of tests 244 is 39% less than 400 in build 
#1212
- Cache 2: Number of tests 411 is 44% less than 729 in build #44615
- Cache 5: Number of tests 90 is 79% less than 425 in build #44881
- Cache 6: Number of tests 169 is 47% less than 321 in build #45122
- Cache (Failover) 1: Number of tests 26 is 59% less than 64 in build #42055
- Cache (Failover) 2: Number of tests 8 is 89% less than 75 in build #42037
- Data Structures: Number of tests 349 is 50% less than 694 in build #43013
- Queries 1: Number of tests 877 is 51% less than 1793 in build #44054
- Queries 2: Number of tests 482 is 31% less than 698 in build #43314

(/) No test blockers otherwise; 24 pre-existing/flaky filtered out.

> Improve diagnostics when snapshot/dump directory creation fails
> ---------------------------------------------------------------
>
>                 Key: IGNITE-28843
>                 URL: https://issues.apache.org/jira/browse/IGNITE-28843
>             Project: Ignite
>          Issue Type: Task
>            Reporter: Anton Vinogradov
>            Assignee: Anton Vinogradov
>            Priority: Major
>              Labels: IEP-109, ise
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> When snapshot or dump directory creation fails, Ignite reports only the
> target path with no OS-level cause, e.g.:
>   class org.apache.ignite.IgniteCheckedException: Dump directory can't be
>   created: /opt/ignite/nvme5/snapshot/dump_.../db/cell_2_node_2/
>   cache-replication.replications_v1
> The real reason (permissions, no space, read-only FS, a file where a
> directory is expected, missing mount) is lost because the code uses
> java.io.File.mkdirs(), which returns a boolean and discards the cause.
> mkdirs() also returns false when the directory already exists, which can
> produce a misleading error on retry.
> Fix: create directories via NIO Files.createDirectories(Path). It is
> idempotent for existing directories and throws a typed IOException
> (AccessDeniedException; FileSystemException "No space left on device";
> ReadOnlyFileSystemException; NotDirectoryException / FileAlreadyExists-
> Exception; NoSuchFileException) that carries the OS reason. Include the
> exception class and message in the thrown Ignite exception and attach the
> original exception as the cause.
> Updated:
> - IgniteUtils.ensureDirectory(File, String, IgniteLogger) - shared helper
>   used by WAL, binary metadata, maintenance, snapshot and dump config.
> - CreateDumpFutureTask.prepare() - the exact spot from the report; now
>   routed through ensureDirectory (also removes the inconsistency with
>   saveCacheConfigs, which already used ensureDirectory).
> - SnapshotFutureTask - temp cache-configuration directory.
> - SharedFileTree.mkdir(File, String) - remaining raw-mkdirs throwing site.
> Not changed: IgniteUtils.mkdirs(File) keeps its boolean contract - a
> boolean cannot carry a reason, and 9 call-sites (3 of them ignoring the
> result) rely on it.
> Resulting message example:
>   Failed to create dump directory: /opt/ignite/nvme5/snapshot/.../
>   cell_2_node_2/cache-replication.replications_v1 [reason=Access-
>   DeniedException, detail=/opt/ignite/.../cell_2_node_2: Permission denied]
> Testing:
> IgniteUtilsUnitTest, 3 new cases (plain JUnit, no grid started):
> - ensureDirectoryIsIdempotentForExistingDirectory - an existing directory
>   must not raise an error (guards the mkdirs()-returns-false regression).
> - ensureDirectorySurfacesReasonAndCauseWhenPathComponentIsFile - the
>   message contains "reason=" and the cause is an IOException
>   (deterministic, independent of permissions or the running user).
> - ensureDirectoryReportsAccessDeniedWhenParentNotWritable - a non-writable
>   parent yields AccessDeniedException in both the message and the cause.
>   Guarded with assumeTrue(POSIX) and an assumeFalse writable-probe so it
>   self-skips on non-POSIX filesystems or when running as root.
> Verified locally against the compiled class: OK (3 tests).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to