You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "sashapolo (via GitHub)" <gi...@apache.org> on 2026/04/08 08:12:15 UTC

[PR] IGNITE-28432 Add storage name to segstore [ignite-3]

sashapolo opened a new pull request, #7953:
URL: https://github.com/apache/ignite-3/pull/7953

   https://issues.apache.org/jira/browse/IGNITE-28432
   
   Thank you for submitting the pull request.
   
   To streamline the review process of the patch and ensure better code quality
   we ask both an author and a reviewer to verify the following:
   
   ### The Review Checklist
   - [ ] **Formal criteria:** TC status, codestyle, mandatory documentation. Also make sure to complete the following:  
   \- There is a single JIRA ticket related to the pull request.  
   \- The web-link to the pull request is attached to the JIRA ticket.  
   \- The JIRA ticket has the Patch Available state.  
   \- The description of the JIRA ticket explains WHAT was made, WHY and HOW.  
   \- The pull request title is treated as the final commit message. The following pattern must be used: IGNITE-XXXX Change summary where XXXX - number of JIRA issue.
   - [ ] **Design:** new code conforms with the design principles of the components it is added to.
   - [ ] **Patch quality:** patch cannot be split into smaller pieces, its size must be reasonable.
   - [ ] **Code quality:** code is clean and readable, necessary developer documentation is added if needed.
   - [ ] **Tests code quality:** test set covers positive/negative scenarios, happy/edge cases. Tests are effective in terms of execution time and resources.
   
   ### Notes
   - [Apache Ignite Coding Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Java+Code+Style+Guide)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] IGNITE-28432 Add storage name to segstore [ignite-3]

Posted by "sashapolo (via GitHub)" <gi...@apache.org>.
sashapolo merged PR #7953:
URL: https://github.com/apache/ignite-3/pull/7953


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] IGNITE-28432 Add storage name to segstore [ignite-3]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #7953:
URL: https://github.com/apache/ignite-3/pull/7953#discussion_r3050030740


##########
modules/raft/src/main/java/org/apache/ignite/internal/raft/storage/segstore/RaftLogGarbageCollector.java:
##########
@@ -110,7 +111,7 @@ class RaftLogGarbageCollector {
         this.strategy = strategy;
         this.failureProcessor = failureProcessor;
 
-        gcThread = new IgniteThread(nodeName, "segstore-gc", new GcTask());
+        gcThread = new IgniteThread(nodeName, "segstore-gc-" + storageName, new GcTask());

Review Comment:
   There are two spaces after the comma in the `IgniteThread` constructor call; please remove the extra whitespace to match surrounding formatting.



##########
modules/raft/src/main/java/org/apache/ignite/internal/raft/storage/segstore/SegmentFileManager.java:
##########
@@ -156,13 +158,18 @@ class SegmentFileManager implements ManuallyCloseable {
 
     SegmentFileManager(
             String nodeName,
+            String storageName,
             Path baseDir,
             int stripes,
             FailureProcessor failureProcessor,
             RaftConfiguration raftConfiguration,
             LogStorageConfiguration storageConfiguration
     ) throws IOException {
-        this.segmentFilesDir = baseDir.resolve("segments");
+        this.storageName = storageName;
+
+        Path storageDir = baseDir.resolve(storageName);
+
+        this.segmentFilesDir = storageDir.resolve("segments");

Review Comment:
   `storageName` is used as a path component via `baseDir.resolve(storageName)`. If `storageName` is absolute or contains `..`/separators, this can escape `baseDir` (or create unintended nested directories), potentially writing Raft log files outside the intended data dir. Please validate/sanitize `storageName` (non-null/non-blank, not absolute, no traversal) before resolving it, and fail fast with a clear exception if invalid.



##########
modules/raft/src/main/java/org/apache/ignite/internal/raft/storage/segstore/SegmentFileManager.java:
##########
@@ -156,13 +158,18 @@ class SegmentFileManager implements ManuallyCloseable {
 
     SegmentFileManager(
             String nodeName,
+            String storageName,
             Path baseDir,
             int stripes,
             FailureProcessor failureProcessor,
             RaftConfiguration raftConfiguration,
             LogStorageConfiguration storageConfiguration
     ) throws IOException {
-        this.segmentFilesDir = baseDir.resolve("segments");
+        this.storageName = storageName;
+
+        Path storageDir = baseDir.resolve(storageName);
+
+        this.segmentFilesDir = storageDir.resolve("segments");
         this.stripes = stripes;
         this.isSync = raftConfiguration.fsync().value();

Review Comment:
   The new `storageName` subdirectory layout is a key behavior change, but there is no test asserting that segment/index files are created under `baseDir/<storageName>/...` and that two different `storageName` values do not collide when sharing the same `baseDir`. Please add a targeted test to cover this, so regressions in directory layout are caught.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org