-
Notifications
You must be signed in to change notification settings - Fork 64
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 database replication delay when adding todos #93
Conversation
This change adds logic to ensure newly-added todos are in the returned list. When the Mattermost server running the plugin has database read replicas configured, it is possible that the plugin would miss listing the new todo due to replication delay. This plugin logic attempts to address the issue when it is detected.
Codecov Report
@@ Coverage Diff @@
## master #93 +/- ##
======================================
Coverage 0.00% 0.00%
======================================
Files 8 8
Lines 858 868 +10
======================================
- Misses 858 868 +10
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Simple and elegant.
Thank you very much for the fix 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@DHaussermann You may not be able to reproduce the initial issue due to needing the db replica setup. I think this will just need a general smoke test. |
Yeah, even once I had a proper test environment, the issue took many |
Just checking that this isn't waiting on me for anything. cc. @DHaussermann |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and passed
Regression tested the plugin for proper functionality
- Various cases of creating and sending ToDos
- Creating from a post and adding to thread are working
- All DMs form ToDo bot based on other user actions are working as expected
- Slash commands are working
LGTM!
This change adds logic to ensure newly-added todos are in the
returned list. When the Mattermost server running the plugin has
database read replicas configured, it is possible that the plugin
would miss listing the new todo due to replication delay. This
plugin logic attempts to address the issue when it is detected.
I verified this issue and fix by using a dev server with a database
with read replicas configured.
When writing a fix, I went with something that felt like a good
trade-off on code complexity and speed. i.e. I avoided a simple
sleep, but also didn't want to drastically refactor code to fix
the issue in a slightly-better way. All that said, let me know what
you think.
Fixes #87