-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Enhance revertReplaceSegments api #8166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -75,6 +75,7 @@ | |
| import static org.apache.pinot.spi.utils.CommonConstants.Helix.NUMBER_OF_PARTITIONS_IN_LEAD_CONTROLLER_RESOURCE; | ||
| import static org.apache.pinot.spi.utils.CommonConstants.Helix.UNTAGGED_SERVER_INSTANCE; | ||
| import static org.apache.pinot.spi.utils.CommonConstants.Server.DEFAULT_ADMIN_API_PORT; | ||
| import static org.testng.Assert.fail; | ||
|
|
||
|
|
||
| public class PinotHelixResourceManagerTest { | ||
|
|
@@ -491,6 +492,7 @@ public void testSegmentReplacement() | |
| try { | ||
| ControllerTestUtils.getHelixResourceManager() | ||
| .startReplaceSegments(OFFLINE_SEGMENTS_REPLACE_TEST_TABLE_NAME, segmentsFrom, segmentsTo, false); | ||
| fail(); | ||
| } catch (Exception e) { | ||
| // expected | ||
| } | ||
|
|
@@ -499,6 +501,7 @@ public void testSegmentReplacement() | |
| try { | ||
| ControllerTestUtils.getHelixResourceManager() | ||
| .startReplaceSegments(OFFLINE_SEGMENTS_REPLACE_TEST_TABLE_NAME, segmentsFrom, segmentsTo, false); | ||
| fail(); | ||
| } catch (Exception e) { | ||
| // expected | ||
| } | ||
|
|
@@ -508,20 +511,23 @@ public void testSegmentReplacement() | |
| try { | ||
| ControllerTestUtils.getHelixResourceManager() | ||
| .startReplaceSegments(OFFLINE_SEGMENTS_REPLACE_TEST_TABLE_NAME, segmentsFrom, segmentsTo, false); | ||
| fail(); | ||
| } catch (Exception e) { | ||
| // expected | ||
| } | ||
|
|
||
| // Invalid table | ||
| try { | ||
| ControllerTestUtils.getHelixResourceManager().endReplaceSegments(OFFLINE_TABLE_NAME, lineageEntryId); | ||
| fail(); | ||
| } catch (Exception e) { | ||
| // expected | ||
| } | ||
|
|
||
| // Invalid lineage entry id | ||
| try { | ||
| ControllerTestUtils.getHelixResourceManager().endReplaceSegments(OFFLINE_SEGMENTS_REPLACE_TEST_TABLE_NAME, "aaa"); | ||
| fail(); | ||
| } catch (Exception e) { | ||
| // expected | ||
| } | ||
|
|
@@ -530,6 +536,7 @@ public void testSegmentReplacement() | |
| try { | ||
| ControllerTestUtils.getHelixResourceManager() | ||
| .endReplaceSegments(OFFLINE_SEGMENTS_REPLACE_TEST_TABLE_NAME, lineageEntryId); | ||
| fail(); | ||
| } catch (Exception e) { | ||
| // expected | ||
| } | ||
|
|
@@ -575,6 +582,7 @@ public void testSegmentReplacement() | |
| try { | ||
| ControllerTestUtils.getHelixResourceManager() | ||
| .revertReplaceSegments(OFFLINE_SEGMENTS_REPLACE_TEST_TABLE_NAME, lineageEntryId2, false); | ||
| fail(); | ||
| } catch (Exception e) { | ||
| // expected | ||
| } | ||
|
|
@@ -613,6 +621,7 @@ public void testSegmentReplacement() | |
| try { | ||
| ControllerTestUtils.getHelixResourceManager() | ||
| .startReplaceSegments(OFFLINE_SEGMENTS_REPLACE_TEST_TABLE_NAME, segmentsFrom, segmentsTo, false); | ||
| fail(); | ||
| } catch (Exception e) { | ||
| // expected | ||
| } | ||
|
|
@@ -755,6 +764,14 @@ public void testSegmentReplacementForRefresh() | |
| Assert.assertEquals(new HashSet<>(ControllerTestUtils.getHelixResourceManager() | ||
| .getSegmentsFor(OFFLINE_SEGMENTS_REPLACE_TEST_REFRESH_TABLE_NAME, true)), | ||
| new HashSet<>(Arrays.asList("s3", "s4", "s5"))); | ||
| // Try to revert the first entry should fail | ||
| try { | ||
| ControllerTestUtils.getHelixResourceManager() | ||
| .revertReplaceSegments(OFFLINE_SEGMENTS_REPLACE_TEST_REFRESH_TABLE_NAME, lineageEntryId, false); | ||
| fail(); | ||
| } catch (Exception e) { | ||
| // expected | ||
|
||
| } | ||
|
|
||
| // Add partial segments to indicate incomplete protocol | ||
| ControllerTestUtils.getHelixResourceManager().addNewSegment(OFFLINE_SEGMENTS_REPLACE_TEST_REFRESH_TABLE_NAME, | ||
|
|
@@ -799,6 +816,7 @@ public void testSegmentReplacementForRefresh() | |
| try { | ||
| ControllerTestUtils.getHelixResourceManager() | ||
| .endReplaceSegments(OFFLINE_SEGMENTS_REPLACE_TEST_REFRESH_TABLE_NAME, lineageEntryId2); | ||
| fail(); | ||
| } catch (Exception e) { | ||
| // expected | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.