-
Notifications
You must be signed in to change notification settings - Fork 165
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
RCORE-2063 Fix some client resets potentially failing with AutoClientResetFailed if a new client reset condition occurred before the first one completed #7542
Conversation
Pull Request Test Coverage Report for Build michael.wilkersonbarker_1147Details
💛 - Coveralls |
Don't we want to fix the real issue too (clearing tracking the client reset in case of a rollback)? |
oh, yes - the test was originally rolling back during client reset on purpose to see what the issues are and the client reset tracking entry was being left over, causing the original failure. |
Added client reset error and action tracking to the client reset metadata storage (producing v2) and if the new client reset action is different from the current client reset action, then the older client reset tracking will be removed in favor of the new client reset. Also updated the "Test client migration and rollback with recovery" test to reflect this operation:
|
Can we break this PR up into the three separate PRs? 1) adding the extra info to the client reset tracker to show what the original error was 2) changing it so that if a new client reset of a different type starts it will be allowed to continue 3) any changes to fix up the test ? |
Sure - I can do that, although it may be better to create two PRs - one for the additions and another that allows a different type to continue + updates to migration test |
…et cycles (#7649) * Broke out the client reset error and action storage from PR #7542 * Removed client reset recovery_allowed flag and other updates from review * Updated pending_client_reset store to use the schema metadata tables * Fixed pausing a session does not hold the DB open test * Moved ownership of reset store to SessionWrapper * Fixed migration test crash - need to save client reset error in handle fresh realm downloaded * Updated PendingResetStore to be static functions instead of an initialized object; updates from review * Make ClientReset::error no longer optional; fixed subscriptions tests * updated changelog after release * updates from review
63bce84
to
807aa83
Compare
CHANGELOG.md
Outdated
@@ -17,7 +17,7 @@ | |||
----------- | |||
|
|||
### Internals | |||
* None. | |||
* Fix client reset failure during sync migration due to previous incomplete client reset. ([PR #7542](https://github.com/realm/realm-core/pull/7542), since v13.11.0) |
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.
I think this actually belongs under the Fixed section rather than the Internals section.
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.
Also would be helpful to describe how the client reset failure would manifest. Like what would the error message be for users?
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.
Sure
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.
Looks good. Should we rename the PR to mention the bug being fixed (and not the test)?
src/realm/sync/config.hpp
Outdated
@@ -132,6 +132,11 @@ enum class SyncClientHookEvent { | |||
SessionActivating, | |||
SessionSuspended, | |||
BindMessageSent, | |||
IdentMessageReceived, |
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.
we don't seem to use (yet) most of these events, so maybe we should add them when they're needed
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.
Removed the unused events
What, How & Why?
If a new client reset occurs with a different action (e.g. rolled back to PBS), the original client reset tracking info (e.g. for migrated to FLX) will be removed and the new client reset will be allowed to continue. (Note: the action and error were originally included in this PR, but moved to a new PR #7649.
Added extra sync client hook events to capture different steps along the way during a client reset - this allows the "Test client migration and rollback with recovery" test to pause the client reset and roll back to PBS while the FLX migration client reset is in progress, effective reproducing the condition that was intermittently failing in the past. This test was previously taking 90+ secs to complete and about a third of this time was waiting for the reconnect timer to expire for the sync session that was active during migration and rollback. Added
handle_reconnect()
call after migration/rollback to cancel this timer, shaving around 30 secs off this test.Fixes #7539
☑️ ToDos
[ ] C-API, if public C++ API changed[ ]bindgen/spec.yml
, if public C++ API changed