Skip to content
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

Make the Throughput based assignment and task estimation based on partition assignment configurable. #841

Merged
merged 10 commits into from Jun 29, 2021

Conversation

vmaheshw
Copy link
Collaborator

It is important to be able to enable/disable task estimation based on partition count or throughput based assignment to ensure that we can rollback or disable a feature if we have any issue in production.

Along with this, fixing an issue where if the task estimated is same as minTask, it does not get saved in the zookeeper and needs extra iteration after it throws exception, which we can easily skip.

DEFAULT_ENABLE_THROUGHPUT_BASED_PARTITION_ASSIGNMENT);
_enablePartitionNumBasedTaskCountEstimation = props.getBoolean(CFG_ENABLE_PARTITION_NUM_BASED_TASK_COUNT_ESTIMATION,
DEFAULT_ENABLE_PARTITION_NUM_BASED_TASK_COUNT_ESTIMATION);

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: empty line

}

private void testValidThroughputBasedPartitionAssignmentPath(boolean enablePartitionCountBasedEstimation) {
PartitionThroughputProvider mockProvider = mock(PartitionThroughputProvider.class);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created a test case like this one to verify metrics in #840. We need to leave just one by merging them.

@@ -247,6 +276,63 @@ public void updatesNumTasksAndThrowsExceptionWhenNoSufficientTasksTest() {
Assert.assertEquals(numTasks2, 2);
}

@Test
public void elasticTaskCountEnabledPathTest() {
testValidThroughputBasedPartitionAssignmentPath(true);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to ignore this. I don't see this making code more readable. It's a preference, but I'd rather have duplicate code in tests that's easy to follow. Nested calls add structural complexity.

@vmaheshw vmaheshw merged commit 8f8974a into linkedin:master Jun 29, 2021
vmaheshw added a commit to vmaheshw/brooklin that referenced this pull request Mar 1, 2022
…ation configurable in Strategy (linkedin#841)

It is important to be able to enable/disable task estimation based on partition count or throughput based assignment to ensure that we can rollback or disable a feature if we have any issue in production.

Along with this, fixing an issue where if the task estimated is same as minTask, it does not get saved in the zookeeper and needs extra iteration after it throws exception, which we can easily skip.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants