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

fix: getWatermark to return-1 if any processor returns -1 #402

Merged
merged 5 commits into from
Dec 5, 2022

Conversation

yhl25
Copy link
Contributor

@yhl25 yhl25 commented Dec 5, 2022

Signed-off-by: Yashash H L yashashhl25@gmail.com

while fetching watermark return -1, if the offset timeline store returns -1 for any processor.

Signed-off-by: Yashash H L <yashashhl25@gmail.com>
Signed-off-by: Yashash H L <yashashhl25@gmail.com>
@vigith
Copy link
Contributor

vigith commented Dec 5, 2022

TestFetcherWithSameOTBucket is failing

@vigith
Copy link
Contributor

vigith commented Dec 5, 2022

@whynowy, how do we handle this in Source watermark fetcher?

@vigith vigith marked this pull request as draft December 5, 2022 04:33
if t != -1 && t < epoch {
if t == -1 { // watermark cannot be computed, perhaps a new processing unit was added or offset fell off the timeline
epoch = t
break
Copy link
Contributor

Choose a reason for hiding this comment

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

return -1 for watermark if we don't find an entry in the offset timeline store in any processor

The PR description doesn't match the logic here.

For example, if we have processors A B C, if processor A's watermark for inputOffset is -1, then we break the for loop and skip processors B and C.
The description above means if all A B C returns -1 then we return -1.

Copy link
Contributor

@jy4096 jy4096 Dec 5, 2022

Choose a reason for hiding this comment

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

We already have the logic here
https://github.com/numaproj/numaflow/pull/402/files#diff-6af877f3295078204591f48a2180bc855394b50997f764275b25ef2ffff678daL110-R116

if epoch == math.MaxInt64 {
epoch = -1
}

to return -1 if no entry found in any offset timeline.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated the description

Copy link
Contributor

Choose a reason for hiding this comment

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

But we need to set the overall watermark to -1 if watermark cannot be fetched for any processing unit

Copy link
Contributor

Choose a reason for hiding this comment

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

updated the description

👌

do we still need this logic then?

if epoch == math.MaxInt64 {
epoch = -1
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we don't need it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we need it, if there are no processors, we will return int max

Signed-off-by: Yashash H L <yashashhl25@gmail.com>
Signed-off-by: Yashash H L <yashashhl25@gmail.com>
Signed-off-by: Yashash H L <yashashhl25@gmail.com>
@yhl25 yhl25 marked this pull request as ready for review December 5, 2022 07:04
@yhl25 yhl25 requested a review from jy4096 December 5, 2022 07:07
@vigith vigith changed the title fix: watermark fetch logic fix: getWatermark to return-1 if any processor returns -1 Dec 5, 2022
@vigith vigith merged commit 6504a56 into numaproj:main Dec 5, 2022
whynowy pushed a commit that referenced this pull request Dec 7, 2022
Signed-off-by: Yashash H L <yashashhl25@gmail.com>
@yhl25 yhl25 deleted the watermark-fix branch January 13, 2023 06:33
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