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

Support cursors for aggregation pipelines #2861

Merged
merged 18 commits into from Jun 23, 2023

Conversation

chilagrow
Copy link
Contributor

@chilagrow chilagrow commented Jun 20, 2023

Description

Closes #1892.

Also fixes find zero batchSize when it calls cursor.Next(). It should fetch all the rest of documents, not zero document.

Readiness checklist

  • I added/updated unit tests.
  • I added/updated integration/compatibility tests.
  • I added/updated comments and checked rendering.
  • I made spot refactorings.
  • I updated user documentation.
  • I ran task all, and it passed.
  • I ensured that PR title is good enough for the changelog.
  • (for maintainers only) I set Reviewers (@FerretDB/core), Labels, Project and project's Sprint fields.
  • I marked all done items in this checklist.

@chilagrow chilagrow added code/enhancement Some user-visible feature could work better area/aggregations Issues about aggregation pipelines area/cursors Issues about cursors labels Jun 20, 2023
@chilagrow chilagrow self-assigned this Jun 20, 2023
@codecov
Copy link

codecov bot commented Jun 20, 2023

Codecov Report

Merging #2861 (6dcd95f) into main (a1ff494) will decrease coverage by 4.13%.
The diff coverage is 54.90%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2861      +/-   ##
==========================================
- Coverage   63.55%   59.42%   -4.13%     
==========================================
  Files         451      451              
  Lines       23512    23555      +43     
==========================================
- Hits        14943    13998     -945     
- Misses       7603     8573     +970     
- Partials      966      984      +18     
Impacted Files Coverage Δ
internal/handlers/pg/msg_find.go 71.75% <ø> (-10.34%) ⬇️
internal/handlers/pg/msg_aggregate.go 76.83% <51.06%> (-5.55%) ⬇️
internal/handlers/common/getmore.go 90.90% <100.00%> (+0.09%) ⬆️

... and 41 files with indirect coverage changes

Flag Coverage Δ
integration 52.42% <54.90%> (-4.38%) ⬇️
mongodb 4.20% <0.00%> (-0.01%) ⬇️
pg 52.17% <54.90%> (-4.55%) ⬇️
shard-1 4.20% <0.00%> (-36.75%) ⬇️
shard-2 45.06% <49.01%> (+3.47%) ⬆️
shard-3 40.61% <29.41%> (-4.58%) ⬇️
unit 24.29% <0.00%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

@AlekSi AlekSi added this to the Next milestone Jun 20, 2023
@AlekSi AlekSi removed the area/cursors Issues about cursors label Jun 20, 2023
@AlekSi
Copy link
Member

AlekSi commented Jun 20, 2023

CleanShot 2023-06-20 at 13 00 34@2x

Only issues, not PRs

@chilagrow chilagrow removed the area/aggregations Issues about aggregation pipelines label Jun 20, 2023
@chilagrow chilagrow marked this pull request as ready for review June 21, 2023 03:33
@chilagrow chilagrow requested a review from a team as a code owner June 21, 2023 03:33
@chilagrow chilagrow enabled auto-merge (squash) June 21, 2023 03:34
AlekSi
AlekSi previously approved these changes Jun 21, 2023
Copy link
Member

@AlekSi AlekSi left a comment

Choose a reason for hiding this comment

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

Code LGTM, but let's work on all comments

integration/query_test.go Outdated Show resolved Hide resolved
@chilagrow chilagrow requested a review from AlekSi June 21, 2023 07:10
AlekSi
AlekSi previously approved these changes Jun 21, 2023
noisersup
noisersup previously approved these changes Jun 21, 2023
Copy link
Member

@noisersup noisersup left a comment

Choose a reason for hiding this comment

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

LGTM

rumyantseva
rumyantseva previously approved these changes Jun 21, 2023
Copy link
Member

@rumyantseva rumyantseva left a comment

Choose a reason for hiding this comment

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

I'm not sure if we have enough "why" in some comments, but I don't want to block the PR, so feel free to resolve my comment.

integration/aggregate_documents_test.go Outdated Show resolved Hide resolved
Copy link
Member

@noisersup noisersup left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@rumyantseva rumyantseva left a comment

Choose a reason for hiding this comment

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

LGTM

@chilagrow chilagrow merged commit 82f54cd into FerretDB:main Jun 23, 2023
23 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code/enhancement Some user-visible feature could work better
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Support cursors for aggregation pipelines
4 participants