-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 1.3.0
-
Component/s: None
-
None
Running the spec test for PHPLIB-416 demonstrates a bug where ChangeStream returns the first document twice. If we modify the test to trigger three consecutive getMore failures instead of two, we see that the first document is returned three times. This seems to indicate that the resume token is not updated between successive resume attempts.
Running the original test, we can observe the following sequence of commands via APM:
commandStarted: aggregate commandSucceeded: aggregate commandStarted: getMore commandFailed: getMore # first fail point hit, resume is needed commandStarted: aggregate commandSucceeded: aggregate # after successful aggregate response, we replace the change stream's internal cursor # the old cursor is garbage collected, so driver sends killCursors command commandStarted: killCursors commandSucceeded: killCursors commandStarted: getMore commandFailed: getMore # second fail point hit, resume is needed commandStarted: aggregate commandSucceeded: aggregate # same behavior with replacing cursor after a successful resume commandStarted: killCursors commandSucceeded: killCursors # fail points are exhausted, so iteration proceeds (according to batchSize=1) commandStarted: getMore commandSucceeded: getMore commandStarted: getMore commandSucceeded: getMore commandStarted: getMore commandSucceeded: getMore
We can also see that each aggregate command after the first uses the same startAtOperationTime option for $changeStream. This indicates that we're not updating the resume token properly after a resumption has taken place.
- is depended on by
-
PHPLIB-416 Ensure that getMore right after a resume is retried
- Closed
- is related to
-
PHPLIB-366 Implement test runner for change stream spec tests
- Closed
- related to
-
PHPLIB-441 ChangeStream key offset is not advanced when resuming
- Closed