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

dekaf: Fix high watermark reporting #1758

Merged
merged 1 commit into from
Nov 5, 2024

Conversation

jshearer
Copy link
Contributor

@jshearer jshearer commented Nov 4, 2024

Description:

We are returning an incorrectly low high-watermark on the first chunk of a Read. This is unexpected behavior and causes the consumer to be incorrectly behind by 1 fetch chunk (the first one). This should fix the problem going forward, though some affected consumer groups may need to be reset (the equivalent of a re-backfill).

For the collection that this was reported in:

$ flowctl collections read --uncommitted --collection ... | jq -c 'select(.["_meta"]?.ack != true)' | jq -s 'map(.id) | sort_by(.)[]' | uniq > unique_flowctl_ids.txt

$ kcat -o beginning  -b dekaf.estuary-data.com:9092 \                                                                                                                                                                                                                                                                       
-X security.protocol=SASL_SSL \      
-X sasl.mechanism=PLAIN \
-X sasl.username='{}' \             
-X sasl.password="ey.." \
-t ... \
-s value=avro \
-r \ 'https://{}:[email protected]'  -J -C -e | |jq -R "fromjson? | ." | jq -c 'select(.payload.id) | .payload.id' | jq -s -c 'sort_by(.)[]' | uniq > unique_dekaf_ids.txt

$ cat unique_dekaf_ids.txt| | wc -l                                                                                                                                                                                                                                                                                                                      
  680726
$ cat unique_flowctl_ids.txt| uniq | wc -l                                                                                                                                                                                                                                                                                                                    
  686939

... a little while later, testing the fix locally ...

$ kcat -o beginning -b localhost:22262 \                                                                                                                                                                                                                                                                                
-X security.protocol=SASL_PLAINTEXT \
-X sasl.mechanism=PLAIN \
-X sasl.username='{}' \
-X sasl.password="ey.." \
-t ... \
-s value=avro \
-r 'http://{}:ey..@localhost:9081'  -J -C -e | |jq -R "fromjson? | ." | jq -c 'select(.payload.id) | .payload.id' | jq -s -c 'sort_by(.)[]' | uniq > dekaf_fixed_ids.txt

$ cat dekaf_fixed_ids.txt|  wc -l                                                                                                                                                                                                                                                                                                                       
  686954

This change is Reviewable

@jshearer jshearer marked this pull request as ready for review November 4, 2024 21:13
This was causing an incorrectly low high-watermark to be returned in the first Fetch response.  This is an unexpected behavior and caused the consumer to be incorrectly behind by 1 fetch chunk (the first one). This should fix the problem going forward.
@jshearer jshearer force-pushed the jshearer/dekaf_fix_high_watermark_reporting branch from 3a11717 to d188356 Compare November 4, 2024 21:18
@jshearer jshearer requested a review from a team November 4, 2024 21:34
Copy link
Member

@jgraettinger jgraettinger left a comment

Choose a reason for hiding this comment

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

LGTM

@jshearer jshearer merged commit 3213777 into master Nov 5, 2024
4 checks passed
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.

2 participants