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

[SPARK-19564][SPARK-19559][SS][KAFKA] KafkaOffsetReader's consumers should not be in the same group #16902

Closed
wants to merge 3 commits into from

Conversation

lw-lin
Copy link
Contributor

@lw-lin lw-lin commented Feb 12, 2017

What changes were proposed in this pull request?

In KafkaOffsetReader, when error occurs, we abort the existing consumer and create a new consumer. In our current implementation, the first consumer and the second consumer would be in the same group (which leads to SPARK-19559), violating our intention of the two consumers not being in the same group.

The cause is that, in our current implementation, the first consumer is created before groupId and nextId are initialized in the constructor. Then even if groupId and nextId are increased during the creation of that first consumer, groupId and nextId would still be initialized to default values in the constructor for the second consumer.

We should make sure that groupId and nextId are initialized before any consumer is created.

How was this patch tested?

Ran 100 times of KafkaSourceSuite; all passed

# This is the 1st commit message:

Run 100 times

# This is the commit message apache#2:

Revert "Run 100 times"
@lw-lin
Copy link
Contributor Author

lw-lin commented Feb 12, 2017

Let's start by running only KafkaSourceSuite for 100 times

@SparkQA
Copy link

SparkQA commented Feb 12, 2017

Test build #72784 has finished for PR 16902 at commit 0f19af3.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@lw-lin
Copy link
Contributor Author

lw-lin commented Feb 12, 2017

ok all 100 times of KafkaSourceSuite passed.

now let's revert back to one normal pass of testing.

This reverts commit 0f19af3.
@lw-lin lw-lin changed the title [SPARK-19564][SS][KAFKA] KafkaOffsetReader's consumers should not be in the same group [SPARK-19564][SPARK-19559][SS][KAFKA] KafkaOffsetReader's consumers should not be in the same group Feb 12, 2017
@SparkQA
Copy link

SparkQA commented Feb 12, 2017

Test build #72786 has finished for PR 16902 at commit cda7b8f.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@lw-lin
Copy link
Contributor Author

lw-lin commented Feb 12, 2017

@zsxwing would you take a look, thanks!

@zsxwing
Copy link
Member

zsxwing commented Feb 13, 2017

Good catch. LGTM. Thanks!

Merging to master and 2.1.

asfgit pushed a commit that referenced this pull request Feb 13, 2017
…hould not be in the same group

## What changes were proposed in this pull request?

In `KafkaOffsetReader`, when error occurs, we abort the existing consumer and create a new consumer. In our current implementation, the first consumer and the second consumer would be in the same group (which leads to SPARK-19559), **_violating our intention of the two consumers not being in the same group._**

The cause is that, in our current implementation, the first consumer is created before `groupId` and `nextId` are initialized in the constructor. Then even if `groupId` and `nextId` are increased during the creation of that first consumer, `groupId` and `nextId` would still be initialized to default values in the constructor for the second consumer.

We should make sure that `groupId` and `nextId` are initialized before any consumer is created.

## How was this patch tested?

Ran 100 times of `KafkaSourceSuite`; all passed

Author: Liwei Lin <lwlin7@gmail.com>

Closes #16902 from lw-lin/SPARK-19564-.

(cherry picked from commit 2bdbc87)
Signed-off-by: Shixiong Zhu <shixiong@databricks.com>
@asfgit asfgit closed this in 2bdbc87 Feb 13, 2017
@lw-lin lw-lin deleted the SPARK-19564- branch February 13, 2017 08:37
@kayousterhout
Copy link
Contributor

Thanks for fixing this @lw-lin!

cmonkey pushed a commit to cmonkey/spark that referenced this pull request Feb 15, 2017
…hould not be in the same group

## What changes were proposed in this pull request?

In `KafkaOffsetReader`, when error occurs, we abort the existing consumer and create a new consumer. In our current implementation, the first consumer and the second consumer would be in the same group (which leads to SPARK-19559), **_violating our intention of the two consumers not being in the same group._**

The cause is that, in our current implementation, the first consumer is created before `groupId` and `nextId` are initialized in the constructor. Then even if `groupId` and `nextId` are increased during the creation of that first consumer, `groupId` and `nextId` would still be initialized to default values in the constructor for the second consumer.

We should make sure that `groupId` and `nextId` are initialized before any consumer is created.

## How was this patch tested?

Ran 100 times of `KafkaSourceSuite`; all passed

Author: Liwei Lin <lwlin7@gmail.com>

Closes apache#16902 from lw-lin/SPARK-19564-.
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.

4 participants