Conversation
🦋 Changeset detectedLatest commit: a011930 The changes in this PR will be included in the next version bump. This PR includes changesets to release 12 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Sleepful
left a comment
There was a problem hiding this comment.
The changes look good.
streamChangesInternal in particular is a really long function with a lot of edge cases. I suggested some places where it could be broken down a bit, if you find more places that could be extracted, I think that could help with reading through. It is a complex function though, and the complexity cannot be removed. I cannot validate that all the if statements for the various edge cases are correct, I think that's the main oversight of my review.
Other than that, I like the rawChangeStream change, using db.command instead of internal API of mongo driver.
I suggested some changes but not blocking on them. Also if you want to apply some of the suggestions, I figure it might be convenient to merge current PR and do a follow-up PR for any changes.
| * would process below. | ||
| * | ||
| * However we don't commit the LSN after collections are dropped. | ||
| * The prevents the `startAfter` or `resumeToken` from advancing past the drop events. |
There was a problem hiding this comment.
| * The prevents the `startAfter` or `resumeToken` from advancing past the drop events. | |
| * This prevents the `startAfter` or `resumeToken` from advancing past the drop events. |
Noted that it prevents so, but why is it important to prevent the token from advancing in this scenario?
There was a problem hiding this comment.
To be honest, I'm not 100% sure. Can check with @stevensJourney when he's back.
|
@Sleepful Thanks for the review, I implemented some of the cosmetic suggestions. (As mentioned in another comment) Note that for this specific PR, viewing the diff with "ignore whitespace changes" help a lot - a lot of the changes are in the diff simply because of the change in indentation. Regardless, that function is indeed long and difficult to follow. We can try to split that up in a future PR. |
|
Ohhh I keep forgetting about the whitespace, good reminder |
Supersedes #309.
This switches to using aggregate/getMore commands directly, instead of the built-in watch methods.
Motivations:
This removes hacks previously using private APIs from:
This is also the first step in writing a more efficient conversion for raw BSON -> serialized JSON. We can't do that with the driver's change stream implementation, since that doesn't support getting results as raw BSON.
TODO: