Skip to content

Fix testIncrementalHandOffReadsThroughEndOffsets in Kafka/KinesisIndexTaskTest#7264

Merged
gianm merged 5 commits intoapache:masterfrom
jihoonson:fix-stream-task-test
Mar 15, 2019
Merged

Fix testIncrementalHandOffReadsThroughEndOffsets in Kafka/KinesisIndexTaskTest#7264
gianm merged 5 commits intoapache:masterfrom
jihoonson:fix-stream-task-test

Conversation

@jihoonson
Copy link
Copy Markdown
Contributor

Both tests are running with transactional mode, so offsets might not be consecutive. This PR runs two tasks to simulate stale replica.

// Simulating the case when another replica has consumed up to the offset of 8
task.getRunner().setEndOffsets(ImmutableMap.of(0, 8L), false);
normalReplica.getRunner().setEndOffsets(currentOffsets, false);
staleReplica.getRunner().setEndOffsets(currentOffsets, false);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is it assumed that staleReplica has offsets behind normalReplica offsets? Is this testable?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That is my intention, but this test doesn't guarantee that staleReplica is always behind normalReplica. My assumption here is that staleReplica would be stale in most runs.

} else {
rows = new ArrayList<>();
for (byte[] valueBytes : valueBytess) {
log.info("valueBytes len: " + valueBytes.length);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this really an info level log?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oh, it was my debugging log. Will remove.

@gianm gianm merged commit 69a6f11 into apache:master Mar 15, 2019
clintropolis pushed a commit to clintropolis/druid that referenced this pull request Mar 15, 2019
…xTaskTest (apache#7264)

* Fix testIncrementalHandOffReadsThroughEndOffsets in Kafka/KinesisIndexTaskTest

* revert unnecessary change

* fix test

* remove debug log
fjy pushed a commit that referenced this pull request Mar 15, 2019
…xTaskTest (#7264) (#7270)

* Fix testIncrementalHandOffReadsThroughEndOffsets in Kafka/KinesisIndexTaskTest

* revert unnecessary change

* fix test

* remove debug log
@jihoonson jihoonson added this to the 0.15.0 milestone May 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants