You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@phoenix.apache.org by "tkhurana (via GitHub)" <gi...@apache.org> on 2024/10/09 18:56:57 UTC

[PR] PHOENIX-7422 Fix Flapper TableTTLIT#testMinorCompactionShouldNotRetainCellsWhenMaxLookbackIsDisabled [phoenix]

tkhurana opened a new pull request, #1999:
URL: https://github.com/apache/phoenix/pull/1999

   When multiple updates happen to the same row within the same millisecond the latest update simply overwrites the cells of the previous update. This breaks the test.


-- 
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: issues-unsubscribe@phoenix.apache.org

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


Re: [PR] PHOENIX-7422 Fix Flapper TableTTLIT#testMinorCompactionShouldNotRetainCellsWhenMaxLookbackIsDisabled [phoenix]

Posted by "kadirozde (via GitHub)" <gi...@apache.org>.
kadirozde commented on code in PR #1999:
URL: https://github.com/apache/phoenix/pull/1999#discussion_r1794437772


##########
phoenix-core/src/it/java/org/apache/phoenix/end2end/TableTTLIT.java:
##########
@@ -261,25 +261,35 @@ public void testMinorCompactionShouldNotRetainCellsWhenMaxLookbackIsDisabled()
             final int flushCount = 10;
             byte[] row = Bytes.toBytes("a");
             int rowUpdateCounter = 0;
-            for (int i = 0; i < flushCount; i++) {
-                // Generate more row versions than the maximum cell versions for the table
-                int updateCount = RAND.nextInt(10) + versions;
-                rowUpdateCounter += updateCount;
-                for (int j = 0; j < updateCount; j++) {
-                    updateRow(conn, tableName, "a");
+            try {
+                for (int i = 0; i < flushCount; i++) {
+                    // Generate more row versions than the maximum cell versions for the table
+                    int updateCount = RAND.nextInt(10) + versions;
+                    rowUpdateCounter += updateCount;
+                    LOG.info(String.format("Iteration:%d uc:%d cntr:%d",
+                            i, updateCount, rowUpdateCounter));
+                    for (int j = 0; j < updateCount; j++) {
+                        updateRow(conn, tableName, "a");
+                        // Sometimes multiple updates to the same row are done in the same millisecond
+                        // This results in overwriting the previous version which breaks the test
+                        Thread.sleep(1);
+                    }
+                    flush(TableName.valueOf(tableName));
+                    // Flushes dump and retain all the cells to HFile.
+                    // Doing MAX_COLUMN_INDEX + 1 to account for empty cells
+                    assertEquals(TestUtil.getRawCellCount(conn, TableName.valueOf(tableName), row),
+                            rowUpdateCounter * (MAX_COLUMN_INDEX + 1));
                 }
-                flush(TableName.valueOf(tableName));
-                // Flushes dump and retain all the cells to HFile.
-                // Doing MAX_COLUMN_INDEX + 1 to account for empty cells
-                assertEquals(TestUtil.getRawCellCount(conn, TableName.valueOf(tableName), row),
-                        rowUpdateCounter * (MAX_COLUMN_INDEX + 1));
+                TestUtil.dumpTable(conn, TableName.valueOf(tableName));

Review Comment:
   I think dumpTable was not intentionally left in the earlier commit. We can remove its occurrences.



-- 
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: issues-unsubscribe@phoenix.apache.org

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


Re: [PR] PHOENIX-7422 Fix Flapper TableTTLIT#testMinorCompactionShouldNotRetainCellsWhenMaxLookbackIsDisabled [phoenix]

Posted by "tkhurana (via GitHub)" <gi...@apache.org>.
tkhurana merged PR #1999:
URL: https://github.com/apache/phoenix/pull/1999


-- 
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: issues-unsubscribe@phoenix.apache.org

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


Re: [PR] PHOENIX-7422 Fix Flapper TableTTLIT#testMinorCompactionShouldNotRetainCellsWhenMaxLookbackIsDisabled [phoenix]

Posted by "kadirozde (via GitHub)" <gi...@apache.org>.
kadirozde commented on code in PR #1999:
URL: https://github.com/apache/phoenix/pull/1999#discussion_r1794437772


##########
phoenix-core/src/it/java/org/apache/phoenix/end2end/TableTTLIT.java:
##########
@@ -261,25 +261,35 @@ public void testMinorCompactionShouldNotRetainCellsWhenMaxLookbackIsDisabled()
             final int flushCount = 10;
             byte[] row = Bytes.toBytes("a");
             int rowUpdateCounter = 0;
-            for (int i = 0; i < flushCount; i++) {
-                // Generate more row versions than the maximum cell versions for the table
-                int updateCount = RAND.nextInt(10) + versions;
-                rowUpdateCounter += updateCount;
-                for (int j = 0; j < updateCount; j++) {
-                    updateRow(conn, tableName, "a");
+            try {
+                for (int i = 0; i < flushCount; i++) {
+                    // Generate more row versions than the maximum cell versions for the table
+                    int updateCount = RAND.nextInt(10) + versions;
+                    rowUpdateCounter += updateCount;
+                    LOG.info(String.format("Iteration:%d uc:%d cntr:%d",
+                            i, updateCount, rowUpdateCounter));
+                    for (int j = 0; j < updateCount; j++) {
+                        updateRow(conn, tableName, "a");
+                        // Sometimes multiple updates to the same row are done in the same millisecond
+                        // This results in overwriting the previous version which breaks the test
+                        Thread.sleep(1);
+                    }
+                    flush(TableName.valueOf(tableName));
+                    // Flushes dump and retain all the cells to HFile.
+                    // Doing MAX_COLUMN_INDEX + 1 to account for empty cells
+                    assertEquals(TestUtil.getRawCellCount(conn, TableName.valueOf(tableName), row),
+                            rowUpdateCounter * (MAX_COLUMN_INDEX + 1));
                 }
-                flush(TableName.valueOf(tableName));
-                // Flushes dump and retain all the cells to HFile.
-                // Doing MAX_COLUMN_INDEX + 1 to account for empty cells
-                assertEquals(TestUtil.getRawCellCount(conn, TableName.valueOf(tableName), row),
-                        rowUpdateCounter * (MAX_COLUMN_INDEX + 1));
+                TestUtil.dumpTable(conn, TableName.valueOf(tableName));

Review Comment:
   I think this was not intentionally left in earlier commit. We can remove it.



-- 
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: issues-unsubscribe@phoenix.apache.org

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