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

RCORE-1973 Add role/permissions tests for new bootstrap feature #7675

Merged
merged 34 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
67691ce
Moved role change tests to separate test file
Jun 11, 2024
2d304d5
Fixed building of new flx_role_change.cpp file
Jun 11, 2024
8d91a08
Added local changes w/role bootstrap test - fixed exception in subscr…
Jun 16, 2024
e8924dc
Merge branch 'feature/role-change' of github.com:realm/realm-core int…
Jun 16, 2024
ac79b1f
Updated local change test to include valid offline writes during role…
Jun 17, 2024
b78283e
Added role change test during initial schema bootstrap
Jun 18, 2024
d350217
Merge branch 'feature/role-change' of github.com:realm/realm-core int…
Jun 18, 2024
f9aec9b
Updated changelog
Jun 18, 2024
2d908be
Wrapped up role change during bootstrap tests
Jun 19, 2024
1878811
Merge branch 'feature/role-change' of github.com:realm/realm-core int…
Jun 19, 2024
89b2c39
Removed debug statments to fix thread sanitizer
Jun 19, 2024
363581c
Updated sub state comments and reverted a minor change
Jun 19, 2024
990da9e
updates from review
Jun 19, 2024
fb91292
Merge branch 'feature/role-change' of github.com:realm/realm-core int…
Jun 19, 2024
5ad76e9
Refactored role change tests and broke out into 2 separate test cases
Jun 19, 2024
2eb382e
Moved harness from a global to a static var in each test case
Jun 19, 2024
6092943
Reverted resetting the bootstrapping subscription state back to Pending
Jun 20, 2024
560cdb3
Updated baas to use protocol v14 and removed the feature flag for rol…
Jun 20, 2024
7951ef2
Removed left over code in statement...
Jun 20, 2024
304e658
Updated baasaas version to be a cached version
Jun 20, 2024
6994a85
Updated baasaas githash and reordered role change during bootstrap to…
Jun 20, 2024
579c50d
Merge branch 'feature/role-change' of github.com:realm/realm-core int…
Jun 20, 2024
7983f9d
Minor updates to reuse the verify_records() fcn
Jun 25, 2024
3f17ce6
Merge branch 'feature/role-change' of github.com:realm/realm-core int…
Jun 28, 2024
524261a
Updates from review
Jun 28, 2024
48497b1
Merge branch 'feature/role-change' of github.com:realm/realm-core int…
Jul 1, 2024
2d67e5d
Updated changelog after release
Jul 1, 2024
2d27215
Fixed one more comment in changelog
Jul 1, 2024
7ee0ad0
Merge branch 'feature/role-change' of github.com:realm/realm-core int…
Jul 1, 2024
75c9654
Merge branch 'feature/role-change' of github.com:realm/realm-core int…
Jul 1, 2024
321b889
RCORE-2174 Bootstrap store is not being reset if initial subscription…
Jul 1, 2024
9f4b041
Merge branch 'feature/role-change' of github.com:realm/realm-core int…
Jul 2, 2024
f869865
Updated changelog comments
Jul 3, 2024
2e5a010
Merge branch 'feature/role-change' of github.com:realm/realm-core int…
Jul 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

### Internals
* FLX download estimates are now tracked in a multiprocess-compatible manner ([PR #7780](https://github.com/realm/realm-core/pull/7780)).
* Create additional role change tests to verify role change during initial schema and subscription bootstraps. ([PR #7675](https://github.com/realm/realm-core/pull/7675))

----------------------------------------------

Expand Down
4 changes: 2 additions & 2 deletions dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ VERSION: 14.10.1
OPENSSL_VERSION: 3.2.0
ZLIB_VERSION: 1.2.13
# https://github.com/10gen/baas/commits
# 30c10fd is 2024 June 6
BAAS_VERSION: 30c10fd8e9400fc77e594340422d8b75c210e18d
# 458cf26 is 2024 June 20
BAAS_VERSION: 458cf268367cb5db1abba731b67ef1d0b9de1cd4
BAAS_VERSION_TYPE: githash
4 changes: 4 additions & 0 deletions src/realm/sync/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1207,6 +1207,10 @@ void SessionWrapper::on_flx_sync_progress(int64_t new_version, DownloadBatchStat
if (!has_flx_subscription_store()) {
return;
}
// Is this a server-initiated bootstrap? Skip notifying the subscription store
if (new_version == m_flx_active_version) {
return;
}
REALM_ASSERT(!m_finalized);
REALM_ASSERT(new_version >= m_flx_last_seen_version);
Copy link
Collaborator

Choose a reason for hiding this comment

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

shouldn't new_version always be either m_flx_last_seen_version, m_flx_active_version or m_flx_active_version+1?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If a query bootstrap is in progress when a server initiated bootstrap takes place (which cancels the current query bootstrap), m_flx_last_seen_version will be m_flx_active_version + 1 while new_version will be m_flx_active_version and this assertion will fail.

Copy link
Collaborator

Choose a reason for hiding this comment

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

it's still one of the cases I mentioned. I was proposing we update the assert, not keep the deleted one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the m_flx_last_seen_version can actually be greater than m_flx_active_version + 1 in the case of a QUERY_ERROR response and it always starts out at 0 when the session is started until the first download message is received. Since the current validation and checking for server-initiated bootstrap logic is valid, I am going to leave this as-is.

Copy link
Collaborator

@danieltabacaru danieltabacaru Jun 19, 2024

Choose a reason for hiding this comment

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

It seems that m_flx_last_seen_version should be updated when we get a query error then. m_flx_active_version is initialized though when the SessionWrapper is actualized. Either way, your call.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would update it, but this is a change that might affect progress notifications, which uses this value. I created RCORE-2173 to handle updating this separately if we want to update it.

REALM_ASSERT(new_version >= m_flx_active_version);
Expand Down
1 change: 1 addition & 0 deletions test/object-store/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ if(REALM_ENABLE_SYNC)
sync/app.cpp
sync/client_reset.cpp
sync/flx_migration.cpp
sync/flx_role_change.cpp
sync/flx_schema_migration.cpp
sync/flx_sync.cpp
sync/metadata.cpp
Expand Down
Loading
Loading