-
Notifications
You must be signed in to change notification settings - Fork 173
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
Only track pending client resets done by the same core version #7944
Conversation
If the previous attempt at performing a client reset was done with a different core version then we should retry the client reset as the new version may have fixed a bug that made the previous attempt fail (or may be a downgrade to a version before when the bug was introduced). This also simplifies the tracking as it means that we don't need to be able to read trackers created by different versions. This also means that we can freely change the schema of the table, which this takes advantage of to drop the unused primary key and make the error required, as we never actually stored null and the code reading it would have crashed if it encountered a null error.
5a1a7b6
to
1815605
Compare
Pull Request Test Coverage Report for Build thomas.goyne_478Details
💛 - Coveralls |
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.
Good idea! LGTM. 👍
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 - I like this better than my original approach of trying to convert the record over - and it make sense to try to restart the client reset again after an upgrade.
If the previous attempt at performing a client reset was done with a different core version than the current one, then attempting the client reset again is not yet a cycle as something significant has changed between the two attempts. This means that we don't actually need the ability to read old client reset tracker schemas; if the schema isn't an exact match we can just discard the existing data.
Running with the idea that retrying the client reset if the core version has changed is not only acceptable but desirable, I also made it store the exact core version which wrote the tracker entry and discard it if the version has changed even if the schema hasn't.
Since I was touching the schema for this anyway, I removed the unused primary key and made the error fields required - we never actually used a null error, and the code reading the tracker entry crashed if it encountered one (
obj.get<int64_t>()
requires that you check for null first, which the code didn't do).