[SERVER-34789] Using resume token from an 'invalidate' notification with 'resumeAfter' should error Created: 02/May/18  Updated: 29/Oct/23  Resolved: 27/Jun/18

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: 4.0.1, 4.1.1

Type: Bug Priority: Major - P3
Reporter: Ian Boros Assignee: Nicholas Zolnierz
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Documented
is documented by DOCS-11901 Docs for SERVER-34789: Using resume t... Closed
Related
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.0
Sprint: Query 2018-07-02
Participants:
Linked BF Score: 46

 Description   

After renaming a collection being watched, or renaming another collection to a collection being watched, it's possible to resume the change stream.

 

This should probably produce an error instead.

 

Also, note that we have tests which exercise this behavior, but don't assert that an error is thrown. These tests should be modified.

jstests/change_streams/change_stream_rename_resumability.js
jstests/change_streams/change_stream_rename_target.js 

 
Edit (6/18):

The desired behavior is to return an "invalidate" notification if resuming a change stream with a resume token from a command that would normally invalidate the stream. For example, resuming from the token of a collection drop notification on a single-collection change stream should return an "invalidate" then subsequently close the cursor. Resuming from the token of the invalidate notification itself should throw an error.



 Comments   
Comment by Githook User [ 01/Mar/19 ]

Author:

{'name': 'Nick Zolnierz', 'email': 'nicholas.zolnierz@mongodb.com', 'username': 'nzolnierzmdb'}

Message: SERVER-34789 Also backport resume token format version 1

(cherry picked from commit bbe67b5bdd596f4720b19f9f4c8c38cfadb9c1dd)
Branch: v4.0
https://github.com/mongodb/mongo/commit/7e86ff743d75a3cd9a76249740c9e659b5f93cf3

Comment by Githook User [ 10/Jul/18 ]

Author:

{'username': 'nzolnierzmdb', 'name': 'Nick Zolnierz', 'email': 'nicholas.zolnierz@mongodb.com'}

Message: SERVER-34789: Using resume token from 'invalidate' notification for 'resumeAfter' should error

(cherry picked from commit bbe67b5bdd596f4720b19f9f4c8c38cfadb9c1dd)
Branch: v4.0
https://github.com/mongodb/mongo/commit/a56ec59387b5b97cde5196358a6c57e7a7861f42

Comment by Githook User [ 03/Jul/18 ]

Author:

{'username': 'nzolnierzmdb', 'name': 'Nick Zolnierz', 'email': 'nicholas.zolnierz@mongodb.com'}

Message: Revert "SERVER-34789: Using resume token from 'invalidate' notification for 'resumeAfter' should error"

This reverts commit f51b8af597b12d89065cb3bcae6d393d632ef088.
Branch: v4.0
https://github.com/mongodb/mongo/commit/0d2cc7c6579993e1bc71c62ea6cd9b1aa72642ba

Comment by Githook User [ 02/Jul/18 ]

Author:

{'username': 'nzolnierzmdb', 'name': 'Nick Zolnierz', 'email': 'nicholas.zolnierz@mongodb.com'}

Message: SERVER-34789: Using resume token from 'invalidate' notification for 'resumeAfter' should error

(cherry picked from commit bbe67b5bdd596f4720b19f9f4c8c38cfadb9c1dd)
Branch: v4.0
https://github.com/mongodb/mongo/commit/f51b8af597b12d89065cb3bcae6d393d632ef088

Comment by Githook User [ 27/Jun/18 ]

Author:

{'username': 'nzolnierzmdb', 'name': 'Nick Zolnierz', 'email': 'nicholas.zolnierz@mongodb.com'}

Message: SERVER-34789: Using resume token from 'invalidate' notification for 'resumeAfter' should error
Branch: master
https://github.com/mongodb/mongo/commit/bbe67b5bdd596f4720b19f9f4c8c38cfadb9c1dd

Comment by Charlie Swanson [ 10/May/18 ]

asya yes, but only for "resumeAfter". If we do add a "startAfter" parameter, it should not return an error.

Comment by Spencer Brody (Inactive) [ 02/May/18 ]

+1

We could just add a 'fromInvalidate' bool into the resumeToken at the end pretty easily

Generated at Thu Feb 08 04:37:51 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.