Skip to content

[BEAM-22089] Fix query retry in Java FirestoreIO - #22175

Merged
chamikaramj merged 1 commit into
apache:masterfrom
danthev:fix/beam_fs_query_resume
Jul 15, 2022
Merged

[BEAM-22089] Fix query retry in Java FirestoreIO#22175
chamikaramj merged 1 commit into
apache:masterfrom
danthev:fix/beam_fs_query_resume

Conversation

@danthev

Copy link
Copy Markdown
Contributor

This fixes a condition where, when a RunQuery request is retried, the cursor inferred from the last received value is set incorrectly, potentially yielding no or skipping some results. This can happen due to nested field paths in the orderBy or when the implicit order (e.g. by name) is not filled correctly. See also #22089.
This PR fixes both root-causes along with unit test cases for each.


Java tests

@danthev

Copy link
Copy Markdown
ContributorAuthor

R: @yixiaoshen
R: @clement

@yixiaoshen

Copy link
Copy Markdown
Contributor

LGTM. please also get a review from someone else.

@danthev

Copy link
Copy Markdown
ContributorAuthor

R: @johnjcasey
(yixiaoshen@ has approved, review by clem@ still pending)

@johnjcasey

Copy link
Copy Markdown
Contributor

Nothing looks bad to me, but a lot of this is firestore specific, so its hard to judge from a BeamIO perspective

@danthev

Copy link
Copy Markdown
ContributorAuthor

Code is ready again, fixed some spotless errors after adding all the unit tests, filter sorting etc.

@danthev
danthevforce-pushed the fix/beam_fs_query_resume branch from 73ed328 to c314775CompareJuly 12, 2022 23:02
@danthev
danthevforce-pushed the fix/beam_fs_query_resume branch from c314775 to ad3af31CompareJuly 12, 2022 23:30

@johnjcaseyjohnjcasey left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, though I think a lot of this is very low level encoding work, and should probably be pushed down to the Firestore library itself

@johnjcasey

Copy link
Copy Markdown
Contributor

@pabloem@chamikaramj for final pass & merge

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@danthev@yixiaoshen@johnjcasey@clement@chamikaramj