-
Notifications
You must be signed in to change notification settings - Fork 11.3k
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
[gql] Watermark task reads from watermarks table, use watermarks for Event::paginate
#21176
base: main
Are you sure you want to change the base?
Conversation
… table. This is used for Event::paginate, so we can correctly bound the available range of data
The latest updates on your projects. Learn more about Vercel for Git ↗︎
2 Skipped Deployments
|
…x for the lowest checkpoint. updated to pass test_health_check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main body of this change looks good, but I think there's a subtle issue with the change to Event::paginate
when a cursor supplies its own consistency cursor -- PTAL!
@@ -134,10 +134,18 @@ impl Event { | |||
db: &Db, | |||
page: Page<Cursor>, | |||
filter: EventFilter, | |||
checkpoint_viewed_at: u64, | |||
watermark: &Watermark, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general checkpoint_viewed_at
and Watermark
are not always interchangeable (you get into issues if this function is used to handle a paginated query that is nested in some other paginated query).
Today, I don't think we use this function for that, (I can see from this PR that you only needed to update a top-level field on Query
), but we generally expect functions called paginate
to work like that.
Given there's only one call-site, could we shift the boundary slightly here so that we accept both a checkpoint_viewed_at
and a tx_lo
, and then go on from there?
let (prev, next, results) = db | ||
.execute(move |conn| async move { | ||
let tx_hi: i64 = conn.first(move || { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change behaves differently if there is a cursor_viewed_at
, right?
Description
Watermark task now reads from watermarks table instead of checkpoints table. This is used for Event::paginate, so we can correctly bound the available range of data
Test plan
Pointed local graphql to current mainnet db. Ran the query below:
Received expected page of results instead of erroneous result,
Release notes
Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.
For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.