forked from linkedin/venice
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[admin-tool][controller][dvc][samza][test][vpj] Job status reporting …
…to include detailed DVC push error (linkedin#919) * Add new DVC error specific terminal enums in ExecutionStatus and similar ones in PushJobCheckpoints and use it instead of the generic ExecutionStatus#ERROR (which was/will be used for server/other task status): DVC_INGESTION_ERROR_DISK_FULL, DVC_INGESTION_ERROR_MEMORY_LIMIT_REACHED, DVC_INGESTION_ERROR_TOO_MANY_DEAD_INSTANCES, DVC_INGESTION_ERROR_OTHER. * Add a new property rootStatus in ExecutionStatus. rootStatus for these 4 new enums will be ERROR and for other existing enums rootStatus will be itself. Idea is to use status.getRootStatus() for most of the cases. * These new enums will be returned back from DVC to backend/push job polling (via DVC push status store) and update the respective new checkpoints in VPJ. Still continue to set PushJobDetailsStatus#ERROR for pushJobDetails.overallStatus * Deployment order: These new statuses are emitted by DaVinci hosts. Other components should be deployed before the Davinci release to be able to act on these new statuses accordingly.
- Loading branch information
1 parent
7663fde
commit 5ffbfb9
Showing
37 changed files
with
1,421 additions
and
262 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
93 changes: 93 additions & 0 deletions
93
clients/da-vinci-client/src/test/java/com/linkedin/davinci/DaVinciBackendTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
package com.linkedin.davinci; | ||
|
||
import static com.linkedin.venice.pushmonitor.ExecutionStatus.DVC_INGESTION_ERROR_OTHER; | ||
import static com.linkedin.venice.utils.DataProviderUtils.allPermutationGenerator; | ||
import static org.testng.Assert.assertEquals; | ||
import static org.testng.Assert.fail; | ||
|
||
import com.linkedin.venice.exceptions.DiskLimitExhaustedException; | ||
import com.linkedin.venice.exceptions.MemoryLimitExhaustedException; | ||
import com.linkedin.venice.exceptions.VeniceException; | ||
import com.linkedin.venice.pushmonitor.ExecutionStatus; | ||
import org.testng.annotations.DataProvider; | ||
import org.testng.annotations.Test; | ||
|
||
|
||
public class DaVinciBackendTest { | ||
@DataProvider(name = "DvcErrorExecutionStatus") | ||
public static Object[][] dvcErrorExecutionStatus() { | ||
return allPermutationGenerator((permutation) -> { | ||
ExecutionStatus status = (ExecutionStatus) permutation[0]; | ||
return status.isDVCIngestionError(); | ||
}, ExecutionStatus.values()); | ||
} | ||
|
||
@Test(dataProvider = "DvcErrorExecutionStatus") | ||
public void testGetDaVinciErrorStatus(ExecutionStatus executionStatus) { | ||
VeniceException veniceException; | ||
switch (executionStatus) { | ||
case DVC_INGESTION_ERROR_DISK_FULL: | ||
veniceException = new DiskLimitExhaustedException("test"); | ||
break; | ||
case DVC_INGESTION_ERROR_MEMORY_LIMIT_REACHED: | ||
veniceException = new MemoryLimitExhaustedException("test"); | ||
break; | ||
case DVC_INGESTION_ERROR_TOO_MANY_DEAD_INSTANCES: | ||
case DVC_INGESTION_ERROR_OTHER: | ||
veniceException = new VeniceException("test"); | ||
break; | ||
default: | ||
fail("Unexpected execution status: " + executionStatus); | ||
return; | ||
} | ||
assertEquals( | ||
DaVinciBackend.getDaVinciErrorStatus(veniceException), | ||
executionStatus.equals(ExecutionStatus.DVC_INGESTION_ERROR_TOO_MANY_DEAD_INSTANCES) | ||
? DVC_INGESTION_ERROR_OTHER | ||
: executionStatus); | ||
} | ||
|
||
@Test(dataProvider = "DvcErrorExecutionStatus") | ||
public void testGetDaVinciErrorStatusNested(ExecutionStatus executionStatus) { | ||
VeniceException veniceException; | ||
switch (executionStatus) { | ||
case DVC_INGESTION_ERROR_DISK_FULL: | ||
veniceException = new VeniceException(new DiskLimitExhaustedException("test")); | ||
break; | ||
case DVC_INGESTION_ERROR_MEMORY_LIMIT_REACHED: | ||
veniceException = new VeniceException(new MemoryLimitExhaustedException("test")); | ||
break; | ||
case DVC_INGESTION_ERROR_TOO_MANY_DEAD_INSTANCES: | ||
case DVC_INGESTION_ERROR_OTHER: | ||
veniceException = new VeniceException("test"); | ||
break; | ||
default: | ||
fail("Unexpected execution status: " + executionStatus); | ||
return; | ||
} | ||
assertEquals( | ||
DaVinciBackend.getDaVinciErrorStatus(veniceException), | ||
executionStatus.equals(ExecutionStatus.DVC_INGESTION_ERROR_TOO_MANY_DEAD_INSTANCES) | ||
? DVC_INGESTION_ERROR_OTHER | ||
: executionStatus); | ||
} | ||
|
||
@Test(dataProvider = "DvcErrorExecutionStatus") | ||
public void testGetDaVinciErrorStatusWithInvalidCases(ExecutionStatus executionStatus) { | ||
VeniceException veniceException; | ||
switch (executionStatus) { | ||
case DVC_INGESTION_ERROR_DISK_FULL: | ||
case DVC_INGESTION_ERROR_MEMORY_LIMIT_REACHED: | ||
case DVC_INGESTION_ERROR_TOO_MANY_DEAD_INSTANCES: | ||
case DVC_INGESTION_ERROR_OTHER: | ||
veniceException = new VeniceException("test"); | ||
break; | ||
default: | ||
fail("Unexpected execution status: " + executionStatus); | ||
return; | ||
} | ||
|
||
assertEquals(DaVinciBackend.getDaVinciErrorStatus(veniceException), DVC_INGESTION_ERROR_OTHER); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.