You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "ibessonov (via GitHub)" <gi...@apache.org> on 2025/07/07 14:56:01 UTC
[PR] IGNITE-25851 Allow read-only node configuration files [ignite-3]
ibessonov opened a new pull request, #6209:
URL: https://github.com/apache/ignite-3/pull/6209
https://issues.apache.org/jira/browse/IGNITE-25851
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-25851 Allow read-only node configuration files [ignite-3]
Posted by "sashapolo (via GitHub)" <gi...@apache.org>.
sashapolo commented on code in PR #6209:
URL: https://github.com/apache/ignite-3/pull/6209#discussion_r2191694010
##########
modules/runner/src/main/java/org/apache/ignite/internal/configuration/storage/LocalFileConfigurationStorage.java:
##########
@@ -365,6 +371,13 @@ private void checkAndRestoreConfigFile() {
} catch (IOException e) {
throw new NodeConfigWriteException("Failed to restore config file.", e);
}
+ } else if (!Files.isWritable(configPath)) {
Review Comment:
Not related to this PR, but it would be cool and more consistent if you could replace `configPath.toFile()` calls above with Java NIO API
--
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-25851 Allow read-only node configuration files [ignite-3]
Posted by "sashapolo (via GitHub)" <gi...@apache.org>.
sashapolo commented on code in PR #6209:
URL: https://github.com/apache/ignite-3/pull/6209#discussion_r2191711894
##########
modules/runner/src/main/java/org/apache/ignite/internal/configuration/storage/LocalFileConfigurationStorage.java:
##########
@@ -353,18 +360,25 @@ private static String renderConfig(ConfigObject conf) {
/** Check that configuration file still exists and restore it with latest applied state in case it was deleted. */
private void checkAndRestoreConfigFile() {
- if (!configPath.toFile().exists()) {
+ if (Files.notExists(configPath)) {
try {
- if (configPath.toFile().createNewFile()) {
- if (!latest.isEmpty()) {
- saveConfigFile();
- }
- } else {
- throw new NodeConfigCreateException("Failed to re-create config file");
+ Files.createFile(configPath);
+
+ if (!latest.isEmpty()) {
+ saveConfigFile();
}
+ } catch (FileAlreadyExistsException e){
+ throw new NodeConfigCreateException("Failed to re-create config file");
Review Comment:
```suggestion
throw new NodeConfigCreateException("Failed to re-create config file.");
```
--
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-25851 Allow read-only node configuration files [ignite-3]
Posted by "ibessonov (via GitHub)" <gi...@apache.org>.
ibessonov merged PR #6209:
URL: https://github.com/apache/ignite-3/pull/6209
--
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-25851 Allow read-only node configuration files [ignite-3]
Posted by "ibessonov (via GitHub)" <gi...@apache.org>.
ibessonov commented on code in PR #6209:
URL: https://github.com/apache/ignite-3/pull/6209#discussion_r2191703430
##########
modules/runner/src/main/java/org/apache/ignite/internal/configuration/storage/LocalFileConfigurationStorage.java:
##########
@@ -365,6 +371,13 @@ private void checkAndRestoreConfigFile() {
} catch (IOException e) {
throw new NodeConfigWriteException("Failed to restore config file.", e);
}
+ } else if (!Files.isWritable(configPath)) {
Review Comment:
Sure. About my `toFile` usage in test - I couldn't figure out how to make the file read-only without old file API
--
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