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 2023/08/30 13:18:04 UTC

[GitHub] [ignite-3] sashapolo opened a new pull request, #2517: IGNITE-20187 Pending assignments recovery on Table Manager start

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

   https://issues.apache.org/jira/browse/IGNITE-20187
   
   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


[GitHub] [ignite-3] sashapolo commented on a diff in pull request #2517: IGNITE-20187 Pending assignments recovery on Table Manager start

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


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/TableManager.java:
##########
@@ -525,6 +531,18 @@ public void start() {
 
         lowWatermark.start();
 
+        try {
+            metaStorageMgr.recoveryFinishedFuture()

Review Comment:
   What's the difference? If the future is already complete, handlers will most likely be executed by the current thread anyway



-- 
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


[GitHub] [ignite-3] ibessonov commented on a diff in pull request #2517: IGNITE-20187 Pending assignments recovery on Table Manager start

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


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/TableManager.java:
##########
@@ -525,6 +531,18 @@ public void start() {
 
         lowWatermark.start();
 
+        try {
+            metaStorageMgr.recoveryFinishedFuture()

Review Comment:
   Is it safe to assert that `metaStorageMgr.recoveryFinishedFuture()` is already completed? If so, then I would avoid `thenCompose*`, calling handlers in current thread instead



##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/TableManager.java:
##########
@@ -560,6 +578,19 @@ public CompletableFuture<Boolean> notify(SchemaEventParameters parameters, @Null
         addMessageHandler(clusterService.messagingService());
     }
 
+    private CompletableFuture<Void> performRebalanceOnRecovery(long revision) {
+        var startRange = new ByteArray(PENDING_ASSIGNMENTS_PREFIX);
+        var endRange = new ByteArray(incrementLastChar(PENDING_ASSIGNMENTS_PREFIX));

Review Comment:
   Would it be better to have a constant for the upper bound array as well?



-- 
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


[GitHub] [ignite-3] sashapolo merged pull request #2517: IGNITE-20187 Pending assignments recovery on Table Manager start

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


-- 
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


[GitHub] [ignite-3] kgusakov commented on a diff in pull request #2517: IGNITE-20187 Pending assignments recovery on Table Manager start

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


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/TableManager.java:
##########
@@ -560,6 +578,19 @@ public CompletableFuture<Boolean> notify(SchemaEventParameters parameters, @Null
         addMessageHandler(clusterService.messagingService());
     }
 
+    private CompletableFuture<Void> performRebalanceOnRecovery(long revision) {
+        var startRange = new ByteArray(PENDING_ASSIGNMENTS_PREFIX);
+        var endRange = new ByteArray(incrementLastChar(PENDING_ASSIGNMENTS_PREFIX));

Review Comment:
   Maybe I didn't understand something, but we can receive `IllegalArgumentException` here, if last char is the `Character.MAX_VALUE`. But I think instead we want to have a `new ByteArray(PENDING_ASSIGNMENTS_PREFIX).getBytes(StandardCharsets.UTF_8) ++ [Character.MIN_VALUE])`to achieve the our goal (where ++ is a pseudocode for arrays concatenation).



-- 
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


[GitHub] [ignite-3] sashapolo commented on a diff in pull request #2517: IGNITE-20187 Pending assignments recovery on Table Manager start

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


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/TableManager.java:
##########
@@ -560,6 +578,19 @@ public CompletableFuture<Boolean> notify(SchemaEventParameters parameters, @Null
         addMessageHandler(clusterService.messagingService());
     }
 
+    private CompletableFuture<Void> performRebalanceOnRecovery(long revision) {
+        var startRange = new ByteArray(PENDING_ASSIGNMENTS_PREFIX);
+        var endRange = new ByteArray(incrementLastChar(PENDING_ASSIGNMENTS_PREFIX));

Review Comment:
   > Maybe I didn't understand something, but we can receive IllegalArgumentException here, if last char is the Character.MAX_VALUE
   
   This is true, but should we bother in the real world? Who is going to use Character.MAX_VALUE in their strings?
   
   > But I think instead we want to have a new ByteArray(PENDING_ASSIGNMENTS_PREFIX).getBytes(StandardCharsets.UTF_8) ++ [Character.MIN_VALUE])
   
   This is not true, this will result in an empty range



-- 
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


[GitHub] [ignite-3] sashapolo commented on a diff in pull request #2517: IGNITE-20187 Pending assignments recovery on Table Manager start

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


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/TableManager.java:
##########
@@ -560,6 +578,19 @@ public CompletableFuture<Boolean> notify(SchemaEventParameters parameters, @Null
         addMessageHandler(clusterService.messagingService());
     }
 
+    private CompletableFuture<Void> performRebalanceOnRecovery(long revision) {
+        var startRange = new ByteArray(PENDING_ASSIGNMENTS_PREFIX);
+        var endRange = new ByteArray(incrementLastChar(PENDING_ASSIGNMENTS_PREFIX));

Review Comment:
   Why? This upper bound is used once on node start



-- 
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


[GitHub] [ignite-3] sashapolo commented on a diff in pull request #2517: IGNITE-20187 Pending assignments recovery on Table Manager start

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


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/TableManager.java:
##########
@@ -560,6 +578,19 @@ public CompletableFuture<Boolean> notify(SchemaEventParameters parameters, @Null
         addMessageHandler(clusterService.messagingService());
     }
 
+    private CompletableFuture<Void> performRebalanceOnRecovery(long revision) {
+        var startRange = new ByteArray(PENDING_ASSIGNMENTS_PREFIX);
+        var endRange = new ByteArray(incrementLastChar(PENDING_ASSIGNMENTS_PREFIX));

Review Comment:
   > Maybe I didn't understand something, but we can receive IllegalArgumentException here, if last char is the Character.MAX_VALUE
   
   This is true, but should we bother in the real world? Who is going to use Character.MAX_VALUE in their strings?
   
   > But I think instead we want to have a new ByteArray(PENDING_ASSIGNMENTS_PREFIX).getBytes(StandardCharsets.UTF_8) ++ [Character.MIN_VALUE])
   
   This is not true, this will result in an empty range. `new ByteArray(PENDING_ASSIGNMENTS_PREFIX).getBytes(StandardCharsets.UTF_8) ++ [Character.MAX_VALUE])` is more correct, but ranges do not include their upper bounds, so it is technically not fully correct



-- 
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