You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2022/10/12 22:56:55 UTC

[GitHub] [pinot] Jackie-Jiang commented on a diff in pull request #9579: Fix the bug where uploaded segments cannot be deleted on real-time table

Jackie-Jiang commented on code in PR #9579:
URL: https://github.com/apache/pinot/pull/9579#discussion_r993959893


##########
pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/UpsertTableSegmentUploadIntegrationTest.java:
##########
@@ -87,7 +88,24 @@ public void setUp()
   @AfterClass
   public void tearDown()
       throws IOException {
-    dropRealtimeTable(getTableName());
+    String realtimeTableName = TableNameBuilder.REALTIME.tableNameWithType(getTableName());
+
+    // Test dropping all segments one by one
+    List<String> segments = listSegments(realtimeTableName);
+    assertFalse(segments.isEmpty());
+    for (String segment : segments) {
+      dropSegment(realtimeTableName, segment);
+    }
+    // NOTE: There is a delay to remove the segment from property store
+    TestUtils.waitForCondition((aVoid) -> {
+      try {
+        return listSegments(realtimeTableName).isEmpty();
+      } catch (IOException e) {
+        throw new RuntimeException(e);
+      }
+    }, 60_000L, "Failed to drop the segments");

Review Comment:
   This is part of the tear-down process. `OfflineClusterIntegrationTest` has similar test. We may consider adding dependency to the test so that we can move it into a test, but prefer doing it separately



-- 
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: commits-unsubscribe@pinot.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org