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

Client reset with recovery fixes #7112

Merged
merged 6 commits into from
Nov 23, 2023
Merged

Client reset with recovery fixes #7112

merged 6 commits into from
Nov 23, 2023

Conversation

ironage
Copy link
Contributor

@ironage ironage commented Nov 2, 2023

In stress testing the recovery code paths for https://jira.mongodb.org/browse/HELP-48043 I found a few errors.

  1. We should not resurrect objects that have been deleted by the server when copying local lists with links in them. This could lead to some weird/unexpected state after a recovery, but I wasn't able to create any bad changesets this way.
    Related to Re-create all objects before updating their properties during client_reset::transfer_group() #6291

  2. I also trace the problem reported in the forums by a user based on the exception message "A fatal error occured during client reset: 'Requested index 2 calling get() on set 'anotherschema.arrayfield' when max is 1' (2)." This turned out to be a problem with the LnkSet implementation of sort/distinct. The effect of returning duplicate indices for the client reset code is that the logic keeping track of indexes there breaks. I think the client reset code was the only place calling this (in core at least) so I don't think bug had too wide an impact.

☑️ ToDos

  • 📝 Changelog update
  • 🚦 Tests (or not relevant)
  • C-API, if public C++ API changed.

Copy link

coveralls-official bot commented Nov 3, 2023

Pull Request Test Coverage Report for Build james.stone_426

  • 303 of 317 (95.58%) changed or added relevant lines in 8 files are covered.
  • 57 unchanged lines in 7 files lost coverage.
  • Overall coverage increased (+0.006%) to 91.677%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/realm/object_converter.cpp 51 53 96.23%
test/object-store/collection_fixtures.hpp 12 15 80.0%
test/object-store/sync/client_reset.cpp 199 208 95.67%
Files with Coverage Reduction New Missed Lines %
test/test_table.cpp 1 99.64%
src/realm/sync/noinst/server/server_history.cpp 2 67.9%
src/realm/sync/network/network.cpp 3 89.65%
test/util/compare_groups.cpp 3 54.95%
src/realm/bplustree.cpp 7 75.72%
src/realm/sync/noinst/client_impl_base.cpp 12 85.0%
test/fuzz_group.cpp 29 50.0%
Totals Coverage Status
Change from base Build 1857: 0.006%
Covered Lines: 231579
Relevant Lines: 252603

💛 - Coveralls

@ironage ironage changed the title Do not resurrect objects that have been deleted by Client reset with recovery fixes Nov 18, 2023
@ironage ironage requested review from jedelbo and jbreams November 18, 2023 01:26
@ironage ironage marked this pull request as ready for review November 18, 2023 01:26
@jbreams jbreams requested review from danieltabacaru and removed request for jbreams November 18, 2023 02:00
Copy link
Collaborator

@danieltabacaru danieltabacaru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@ironage ironage merged commit 750db45 into master Nov 23, 2023
30 of 33 checks passed
@ironage ironage deleted the js/reset-recovery branch November 23, 2023 17:57
@kraenhansen
Copy link
Member

@ironage this line in the changelog is missing a "since" entry:

Calling sort() or distinct() on a LnkSet that had unresolved links in it would produce duplicate indices.

Should I assume this was also since v11.16.0?

@ironage
Copy link
Contributor Author

ironage commented Dec 11, 2023

@kraenhansen good catch, that fix is relevant since the introduction of the Set datatype in v10.2.0

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants