You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "denis-chudov (via GitHub)" <gi...@apache.org> on 2024/07/22 20:46:08 UTC

[PR] repeated test [ignite-3]

denis-chudov opened a new pull request, #4121:
URL: https://github.com/apache/ignite-3/pull/4121

   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-20996 Fixed and enabled ItIgniteNodeRestartTest#testCfgGap and ItRebalanceTest#assignmentsChangingOnNodeLeaveNodeJoin [ignite-3]

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


##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItIgniteNodeRestartTest.java:
##########
@@ -1879,7 +1893,59 @@ private static int tableId(IgniteImpl node, String tableName) {
     }
 
     /**
-     * Checks the table exists and validates all data in it.
+     * Checks the table exists and validates all data in the storage of specific node.
+     *
+     * @param ignite Ignite.
+     * @param name Table name.
+     * @param recordsCount Total count of records to check.
+     * @param partNum Partition to check.
+     */
+    private void checkTableWithDataOnSpecificNode(Ignite ignite, String name, int recordsCount, int partNum) {
+        TableImpl table = unwrapTableImpl(ignite.tables().table(name));
+        RecordBinaryViewImpl view = Wrappers.unwrap(table.recordView(), RecordBinaryViewImpl.class);
+
+        AtomicInteger foundRecords = new AtomicInteger();
+
+        Supplier<Boolean> allDataPresent = () -> {
+            foundRecords.set(0);
+
+            try (Cursor<ReadResult> cursor = table.internalTable().storage().getMvPartition(partNum).scan(HybridTimestamp.MAX_VALUE)) {
+                while (cursor.hasNext()) {
+                    ReadResult rr = cursor.next();
+
+                    if (!rr.isWriteIntent()) {

Review Comment:
   we don't want to consider write intents as actual data. Assuming that all transactions are finished, there should be no write intents. Also, writing a record (creating a write intent) and turning write intent into value are different Raft commands, so this check also makes sure that the rebalancing is finished.



-- 
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-20996 Fixed and enabled ItIgniteNodeRestartTest#testCfgGap and ItRebalanceTest#assignmentsChangingOnNodeLeaveNodeJoin [ignite-3]

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


##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItIgniteNodeRestartTest.java:
##########
@@ -1879,7 +1893,59 @@ private static int tableId(IgniteImpl node, String tableName) {
     }
 
     /**
-     * Checks the table exists and validates all data in it.
+     * Checks the table exists and validates all data in the storage of specific node.
+     *
+     * @param ignite Ignite.
+     * @param name Table name.
+     * @param recordsCount Total count of records to check.
+     * @param partNum Partition to check.
+     */
+    private void checkTableWithDataOnSpecificNode(Ignite ignite, String name, int recordsCount, int partNum) {
+        TableImpl table = unwrapTableImpl(ignite.tables().table(name));
+        RecordBinaryViewImpl view = Wrappers.unwrap(table.recordView(), RecordBinaryViewImpl.class);
+
+        AtomicInteger foundRecords = new AtomicInteger();
+
+        Supplier<Boolean> allDataPresent = () -> {
+            foundRecords.set(0);
+
+            try (Cursor<ReadResult> cursor = table.internalTable().storage().getMvPartition(partNum).scan(HybridTimestamp.MAX_VALUE)) {
+                while (cursor.hasNext()) {
+                    ReadResult rr = cursor.next();
+
+                    if (!rr.isWriteIntent()) {

Review Comment:
   got it, thanks!



-- 
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-20996 Fixed and enabled ItIgniteNodeRestartTest#testCfgGap and ItRebalanceTest#assignmentsChangingOnNodeLeaveNodeJoin [ignite-3]

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


##########
modules/core/src/testFixtures/java/org/apache/ignite/internal/testframework/IgniteTestUtils.java:
##########
@@ -947,6 +950,29 @@ public static void fillDummyFile(Path file, long fileSize) throws IOException {
         }
     }
 
+    /**
+     * Run the closure in the given executor, wait for the result and get it synchronously.
+     *
+     * @param executor Executor.
+     * @param closure Closure.
+     * @return Closure result.
+     */
+    public static <T> T runInExecutor(ExecutorService executor, Supplier<T> closure) {
+        Object[] arr = new Object[1];

Review Comment:
   Curious whether it's a common practice to use single element array instead of AtomicReference or just a matter of case?



-- 
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-20996 Fixed and enabled ItIgniteNodeRestartTest#testCfgGap and ItRebalanceTest#assignmentsChangingOnNodeLeaveNodeJoin [ignite-3]

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


##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItIgniteNodeRestartTest.java:
##########
@@ -1879,7 +1893,59 @@ private static int tableId(IgniteImpl node, String tableName) {
     }
 
     /**
-     * Checks the table exists and validates all data in it.
+     * Checks the table exists and validates all data in the storage of specific node.
+     *
+     * @param ignite Ignite.
+     * @param name Table name.
+     * @param recordsCount Total count of records to check.
+     * @param partNum Partition to check.
+     */
+    private void checkTableWithDataOnSpecificNode(Ignite ignite, String name, int recordsCount, int partNum) {
+        TableImpl table = unwrapTableImpl(ignite.tables().table(name));
+        RecordBinaryViewImpl view = Wrappers.unwrap(table.recordView(), RecordBinaryViewImpl.class);
+
+        AtomicInteger foundRecords = new AtomicInteger();
+
+        Supplier<Boolean> allDataPresent = () -> {
+            foundRecords.set(0);
+
+            try (Cursor<ReadResult> cursor = table.internalTable().storage().getMvPartition(partNum).scan(HybridTimestamp.MAX_VALUE)) {
+                while (cursor.hasNext()) {
+                    ReadResult rr = cursor.next();
+
+                    if (!rr.isWriteIntent()) {

Review Comment:
   Why do we need this check?



-- 
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-20996 Fixed and enabled ItIgniteNodeRestartTest#testCfgGap and ItRebalanceTest#assignmentsChangingOnNodeLeaveNodeJoin [ignite-3]

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


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