-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
ChangeStream::resume() should not rewind the cursor if the resuming aggregate command returns an empty firstBatch. Doing so will execute an additional getMore command from within resume().
Apart from resuming, this is also a problem for ChangeStream::rewind(). If the change stream cursor's initial batch is empty, calling ChangeStream::rewind() will also execute a getMore command.
If aggregate does return a non-empty firstBatch, it is safe to rewind as that will merely advance the cursor to the first result (entirely a client-side operation). That is desirable behavior, as resuming should leave the change stream iterator's position at the next element if possible.
- is depended on by
-
PHPLIB-416 Ensure that getMore right after a resume is retried
- Closed
- is related to
-
PHPC-1050 Advancing a new command cursor to check for an error may invoke getMore
- Closed
- related to
-
PHPLIB-379 Capture default startAtOperationTime for change stream from Session instead of APM
- Backlog
-
PHPLIB-448 ChangeStream::rewind() should throw if called after advancing beyond first result
- Backlog