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

SAMZA-2122: Fix the task caught-up logic which doesn't handle no incoming messages #939

Merged
merged 2 commits into from
Mar 6, 2019

Conversation

xinyuiscool
Copy link
Contributor

Currently the TaskInstance.checkCaughtUp() logic has a bug that if there is no incoming messages for a partition, it will not mark the ssp to be caught up. Instead, it should mark ssp to be caught up if the starting offset is already the upcoming offset for a ssp, meaning it has consumed all the messages in this partition and waiting for the future incoming messages. This indicates the ssp is fully caught up.

Copy link
Contributor

@sborya sborya left a comment

Choose a reason for hiding this comment

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

please add the comments.

.getOrElse(throw new SamzaException("No offset defined for SystemStreamPartition: %s" format ssp))

if(Objects.equals(upcomingOffset, startingOffset)) {
ssp2CaughtupMapping(ssp) = true
Copy link
Contributor

Choose a reason for hiding this comment

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

comment here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added.

@@ -321,6 +323,25 @@ class TaskInstance(
}
}

def initCaughtUpMapping() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Comment for the method.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added the comments.

@sborya sborya merged commit a96d481 into apache:master Mar 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants