AmatyaAvadhanula commented on PR #16834:
URL: https://github.com/apache/druid/pull/16834#issuecomment-2271065130
I think the logic may be incorrect.
We should expect the following test (that I have written) to pass with the
current logic and it does.
However, the changes in this patch cause a failure.
```
@Test
public void testAddDiscoveredTaskToPendingCompletionTaskGroupsSync()
{
EasyMock.expect(spec.isSuspended()).andReturn(false).anyTimes();
EasyMock.expect(recordSupplier.getPartitionIds(STREAM)).andReturn(ImmutableSet.of(SHARD_ID)).anyTimes();
EasyMock.expect(taskStorage.getActiveTasksByDatasource(DATASOURCE)).andReturn(ImmutableList.of()).anyTimes();
EasyMock.expect(taskQueue.add(EasyMock.anyObject())).andReturn(true).anyTimes();
replayAll();
SeekableStreamSupervisor supervisor = new TestSeekableStreamSupervisor();
Map<String, String> startingPartiions = new HashMap<>();
startingPartiions.put("partition", "offset");
Map<String, String> startingPartiions1 = new HashMap<>();
startingPartiions.put("partition", "offset1");
supervisor.addDiscoveredTaskToPendingCompletionTaskGroups(0, "task_1",
startingPartiions);
supervisor.addDiscoveredTaskToPendingCompletionTaskGroups(0, "task_2",
startingPartiions);
supervisor.addDiscoveredTaskToPendingCompletionTaskGroups(0, "task_3",
startingPartiions);
supervisor.addDiscoveredTaskToPendingCompletionTaskGroups(0, "task_7",
startingPartiions1);
supervisor.addDiscoveredTaskToPendingCompletionTaskGroups(0, "task_8",
startingPartiions1);
supervisor.addDiscoveredTaskToPendingCompletionTaskGroups(0, "task_9",
startingPartiions1);
CopyOnWriteArrayList<SeekableStreamSupervisor.TaskGroup> taskGroups =
supervisor.getPendingCompletionTaskGroups(0);
Assert.assertEquals(2, taskGroups.size());
Assert.assertEquals(3, taskGroups.get(0).tasks.size());
Assert.assertEquals(3, taskGroups.get(1).tasks.size());
}
```
I think it is because you're handling the task group but not the start
offsets as part of your logic.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]