You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "alievmirza (via GitHub)" <gi...@apache.org> on 2025/09/08 21:35:43 UTC
[PR] IGNITE-26271 fix incorrect calculation of alive data nodes for disaster recovery [ignite-3]
alievmirza opened a new pull request, #6569:
URL: https://github.com/apache/ignite-3/pull/6569
https://issues.apache.org/jira/browse/IGNITE-26271
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-26271 Fix incorrect calculation of alive data nodes for disaster recovery [ignite-3]
Posted by "Cyrill (via GitHub)" <gi...@apache.org>.
Cyrill commented on code in PR #6569:
URL: https://github.com/apache/ignite-3/pull/6569#discussion_r2439822774
##########
modules/table/src/integrationTest/java/org/apache/ignite/internal/table/distributed/disaster/AbstractHighAvailablePartitionsRecoveryTest.java:
##########
@@ -348,17 +347,31 @@ final int zoneIdByName(CatalogService catalogService, String zoneName) {
private void createHaZoneWithTables(
String zoneName, List<String> tableNames, String filter, Set<String> targetNodes) throws InterruptedException {
- createHaZoneWithTables(zoneName, tableNames, filter, DEFAULT_STORAGE_PROFILE, targetNodes);
+ createHaZoneWithTables(zoneName, tableNames, PARTITIONS_NUMBER, null, filter, DEFAULT_STORAGE_PROFILE, targetNodes);
}
private void createHaZoneWithTables(
- String zoneName, List<String> tableNames, String filter, String storageProfiles, Set<String> targetNodes
+ String zoneName,
+ List<String> tableNames,
+ int partitionNumber,
+ @Nullable Integer quorumSize,
Review Comment:
is 0 a valid parameter?
--
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-26271 Fix incorrect calculation of alive data nodes for disaster recovery [ignite-3]
Posted by "Cyrill (via GitHub)" <gi...@apache.org>.
Cyrill commented on code in PR #6569:
URL: https://github.com/apache/ignite-3/pull/6569#discussion_r2439808897
##########
modules/raft/src/main/java/org/apache/ignite/raft/jraft/core/NodeImpl.java:
##########
@@ -1620,8 +1621,18 @@ else if (this.state.compareTo(State.STATE_TRANSFERRING) <= 0) {
}
// Should be in readLock
- private boolean isLearner() {
- return this.conf.listLearners().contains(this.serverId);
+ private boolean isLearner(boolean blocking) {
+ if (!blocking) {
Review Comment:
What about something like this?
```
private boolean isLearnerUnsafe() {
return this.conf.listLearners().contains(this.serverId);
}
private boolean isLearner() {
this.readLock.lock();
try {
return isLearnerUnsafe();
}
finally {
this.readLock.unlock();
}
}
```
--
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-26271 Fix incorrect calculation of alive data nodes for disaster recovery [ignite-3]
Posted by "Cyrill (via GitHub)" <gi...@apache.org>.
Cyrill commented on code in PR #6569:
URL: https://github.com/apache/ignite-3/pull/6569#discussion_r2439900830
##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/disaster/GroupUpdateRequestHandler.java:
##########
@@ -307,6 +307,14 @@ private CompletableFuture<Integer> partitionUpdate(
enrichAssignments(partId, aliveDataNodes, partitions, replicas, consensusGroupSize, partAssignments);
}
+ partAssignments = calculateAssignmentForPartition(
Review Comment:
Please add a comment why we need this
--
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-26271 Fix incorrect calculation of alive data nodes for disaster recovery [ignite-3]
Posted by "Cyrill (via GitHub)" <gi...@apache.org>.
Cyrill commented on code in PR #6569:
URL: https://github.com/apache/ignite-3/pull/6569#discussion_r2439813734
##########
modules/table/src/integrationTest/java/org/apache/ignite/internal/table/distributed/disaster/AbstractHighAvailablePartitionsRecoveryTest.java:
##########
@@ -112,6 +110,7 @@
import org.apache.ignite.table.Table;
import org.apache.ignite.table.Tuple;
import org.apache.ignite.tx.TransactionException;
+import org.checkerframework.checker.nullness.qual.Nullable;
Review Comment:
different nullable, import org.jetbrains.annotations.Nullable;
--
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-26271 Fix incorrect calculation of alive data nodes for disaster recovery [ignite-3]
Posted by "alievmirza (via GitHub)" <gi...@apache.org>.
alievmirza commented on code in PR #6569:
URL: https://github.com/apache/ignite-3/pull/6569#discussion_r2439916593
##########
modules/table/src/integrationTest/java/org/apache/ignite/internal/table/distributed/disaster/AbstractHighAvailablePartitionsRecoveryTest.java:
##########
@@ -112,6 +110,7 @@
import org.apache.ignite.table.Table;
import org.apache.ignite.table.Tuple;
import org.apache.ignite.tx.TransactionException;
+import org.checkerframework.checker.nullness.qual.Nullable;
Review Comment:
good catch, thank you!
--
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-26271 Fix incorrect calculation of alive data nodes for disaster recovery [ignite-3]
Posted by "sanpwc (via GitHub)" <gi...@apache.org>.
sanpwc merged PR #6569:
URL: https://github.com/apache/ignite-3/pull/6569
--
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-26271 Fix incorrect calculation of alive data nodes for disaster recovery [ignite-3]
Posted by "alievmirza (via GitHub)" <gi...@apache.org>.
alievmirza commented on code in PR #6569:
URL: https://github.com/apache/ignite-3/pull/6569#discussion_r2445043287
##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/disaster/GroupUpdateRequestHandler.java:
##########
@@ -307,6 +307,14 @@ private CompletableFuture<Integer> partitionUpdate(
enrichAssignments(partId, aliveDataNodes, partitions, replicas, consensusGroupSize, partAssignments);
}
+ partAssignments = calculateAssignmentForPartition(
Review Comment:
added
##########
modules/transactions/src/integrationTest/java/org/apache/ignite/internal/disaster/DisasterRecoveryTestUtil.java:
##########
@@ -46,6 +47,7 @@
import org.apache.ignite.internal.schema.row.RowAssembler;
import org.apache.ignite.internal.table.InternalTable;
import org.apache.ignite.raft.jraft.rpc.WriteActionRequest;
+import org.checkerframework.checker.nullness.qual.Nullable;
Review Comment:
fixed
--
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-26271 Fix incorrect calculation of alive data nodes for disaster recovery [ignite-3]
Posted by "Cyrill (via GitHub)" <gi...@apache.org>.
Cyrill commented on code in PR #6569:
URL: https://github.com/apache/ignite-3/pull/6569#discussion_r2439836554
##########
modules/transactions/src/integrationTest/java/org/apache/ignite/internal/disaster/DisasterRecoveryTestUtil.java:
##########
@@ -46,6 +47,7 @@
import org.apache.ignite.internal.schema.row.RowAssembler;
import org.apache.ignite.internal.table.InternalTable;
import org.apache.ignite.raft.jraft.rpc.WriteActionRequest;
+import org.checkerframework.checker.nullness.qual.Nullable;
Review Comment:
different nullable
--
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-26271 Fix incorrect calculation of alive data nodes for disaster recovery [ignite-3]
Posted by "alievmirza (via GitHub)" <gi...@apache.org>.
alievmirza commented on code in PR #6569:
URL: https://github.com/apache/ignite-3/pull/6569#discussion_r2445088642
##########
modules/table/src/integrationTest/java/org/apache/ignite/internal/table/distributed/disaster/AbstractHighAvailablePartitionsRecoveryTest.java:
##########
@@ -348,17 +347,31 @@ final int zoneIdByName(CatalogService catalogService, String zoneName) {
private void createHaZoneWithTables(
String zoneName, List<String> tableNames, String filter, Set<String> targetNodes) throws InterruptedException {
- createHaZoneWithTables(zoneName, tableNames, filter, DEFAULT_STORAGE_PROFILE, targetNodes);
+ createHaZoneWithTables(zoneName, tableNames, PARTITIONS_NUMBER, null, filter, DEFAULT_STORAGE_PROFILE, targetNodes);
}
private void createHaZoneWithTables(
- String zoneName, List<String> tableNames, String filter, String storageProfiles, Set<String> targetNodes
+ String zoneName,
+ List<String> tableNames,
+ int partitionNumber,
+ @Nullable Integer quorumSize,
Review Comment:
if we check DdlSqlToCommandConverter, it seems that 0 is valid param, but we also have such comment
```
// We can't properly validate quorum size since it depends on the replicas number.
```
--
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-26271 Fix incorrect calculation of alive data nodes for disaster recovery [ignite-3]
Posted by "alievmirza (via GitHub)" <gi...@apache.org>.
alievmirza commented on code in PR #6569:
URL: https://github.com/apache/ignite-3/pull/6569#discussion_r2446257575
##########
modules/raft/src/main/java/org/apache/ignite/raft/jraft/core/NodeImpl.java:
##########
@@ -1620,8 +1621,18 @@ else if (this.state.compareTo(State.STATE_TRANSFERRING) <= 0) {
}
// Should be in readLock
- private boolean isLearner() {
- return this.conf.listLearners().contains(this.serverId);
+ private boolean isLearner(boolean blocking) {
+ if (!blocking) {
Review Comment:
I decided to leave it as it is, because it matches the pattern that is used for `isLeader(final boolean blocking) {`
--
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