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

Handle expired resumeTokens #4

Open
BartekGravity opened this issue Oct 24, 2023 · 2 comments
Open

Handle expired resumeTokens #4

BartekGravity opened this issue Oct 24, 2023 · 2 comments

Comments

@BartekGravity
Copy link
Contributor

Handle cases, where the resumeToken is expired (usually expires after 48 hours and is deleted from opLog in MongoDB - making it unusable)

@meehaws
Copy link
Contributor

meehaws commented Oct 24, 2023

To be more precise, you can resume a Change Stream only when the resume token used for the change steam is present in the OPLOG. Oplot size is configurable by replSetResizeOplog and can have a minimum time to preserve entries.
If both size of oplog is reached and entries are older than the configured minimum hours, then the resume token will be removed. We want to handle that situation.

https://www.mongodb.com/docs/manual/reference/command/replSetResizeOplog/

@BartekGravity
Copy link
Contributor Author

resumeTokens are now taken from the cursor which should prevent us from "losing" the resumeToken to the oplog if the applciation is running. I'm keeping this open as I need to implement handling cases where application is down and cannot use the token that is stored in the config.

BartekGravity added a commit that referenced this issue May 9, 2024
    * Added support for handling expired tokens gently (start fresh)
BartekGravity added a commit that referenced this issue May 10, 2024
    * Add token printing
BartekGravity added a commit that referenced this issue May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants