Skip to content

Commit

Permalink
Merge branch 'ni/temp-14.10.3' into lj/category-names
Browse files Browse the repository at this point in the history
  • Loading branch information
nirinchev committed Jul 10, 2024
2 parents 40c95c5 + fd428c3 commit cbc571b
Show file tree
Hide file tree
Showing 25 changed files with 270 additions and 146 deletions.
7 changes: 4 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
# NEXT RELEASE
# 14.10.3 Release notes

### Enhancements
* <New feature description> (PR [#????](https://github.com/realm/realm-core/pull/????))
* "Next launch" metadata file actions are now performed in a multi-process safe manner ([#7576](https://github.com/realm/realm-core/pull/7576)).

### Fixed
* <How do the end-user experience this issue? what was the impact?> ([#????](https://github.com/realm/realm-core/issues/????), since v?.?.?)
* Fixed a change of mode from Strong to All when removing links from an embedded object that links to a tombstone. This affects sync apps that use embedded objects which have a `Lst<Mixed>` that contains a link to another top level object which has been deleted by another sync client (creating a tombstone locally). In this particular case, the switch would cause any remaining link removals to recursively delete the destination object if there were no other links to it. ([#7828](https://github.com/realm/realm-core/issues/7828), since 14.0.0-beta.0)
* Fixed removing backlinks from the wrong objects if the link came from a nested list, nested dictionary, top-level dictionary, or list of mixed, and the source table had more than 256 objects. This could manifest as `array_backlink.cpp:112: Assertion failed: int64_t(value >> 1) == key.value` when removing an object. ([#7594](https://github.com/realm/realm-core/issues/7594), since v11 for dictionaries)
* Fixed the collapse/rejoin of clusters which contained nested collections with links. This could manifest as `array.cpp:319: Array::move() Assertion failed: begin <= end [2, 1]` when removing an object. ([#7839](https://github.com/realm/realm-core/issues/7839), since the introduction of nested collections in v14.0.0-beta.0)
* wait_for_upload_completion() was inconsistent in how it handled commits which did not produce any changesets to upload. Previously it would sometimes complete immediately if all commits waiting to be uploaded were empty, and at other times it would wait for a server roundtrip. It will now always complete immediately. ([PR #7796](https://github.com/realm/realm-core/pull/7796)).
* `realm_sync_session_handle_error_for_testing` parameter `is_fatal` was flipped changing the expected behavior. (#[7750](https://github.com/realm/realm-core/issues/7750)).

### Breaking changes
* None.
Expand All @@ -22,6 +21,8 @@
### Internals
* Fixed `Table::remove_object_recursive` which wouldn't recursively follow links through a single `Mixed` property. This feature is exposed publicly on `Table` but no SDK currently uses it, so this is considered internal. ([#7829](https://github.com/realm/realm-core/issues/7829), likely since the introduction of Mixed)
* Upload completion is now tracked in a multiprocess-compatible manner ([PR #7796](https://github.com/realm/realm-core/pull/7796)).
* The local realm will assume the the client file ident of the fresh realm during a client reset. ([PR #7850](https://github.com/realm/realm-core/pull/7850))
* Building using C++20 on Windows.

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

Expand Down
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ if(MSVC)
# We use these in our AtomicSharedPtr implementation and it can't move
# to atomic<shared_ptr<T>> because NotificationToken relies on movability.
add_compile_options(/D_SILENCE_CXX20_OLD_SHARED_PTR_ATOMIC_SUPPORT_DEPRECATION_WARNING)

# Enable __cplusplus macro
add_compile_options(/Zc:__cplusplus)
else()
add_compile_options(-Wall -Wextra -Wempty-body -Wparentheses -Wunknown-pragmas -Wunreachable-code -Wunused-parameter -Wno-missing-field-initializers)
# TODO: Remove this when fixed
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import PackageDescription
import Foundation

let versionStr = "14.10.2"
let versionStr = "14.10.3"
let versionPieces = versionStr.split(separator: "-")
let versionCompontents = versionPieces[0].split(separator: ".")
let versionExtra = versionPieces.count > 1 ? versionPieces[1] : ""
Expand Down
2 changes: 1 addition & 1 deletion dependencies.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PACKAGE_NAME: realm-core
VERSION: 14.10.2
VERSION: 14.10.3
OPENSSL_VERSION: 3.2.0
ZLIB_VERSION: 1.2.13
# https://github.com/10gen/baas/commits
Expand Down
27 changes: 19 additions & 8 deletions evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ functions:
script: |-
if ls crash-*> /dev/null 2>&1; then
echo "Found crash file"
#Rename the crash file and the realm file.
#Rename the crash file and the realm file.
#If there is a crash, this will signal that something needs to be uploaded.
mv crash-* realm-fuzzer-crash.txt
mv fuzz-realm.realm fuzzer_realm.realm
Expand Down Expand Up @@ -459,7 +459,7 @@ functions:
bucket: mciuploads
permissions: public-read
content_type: application/x-binary
display_name: Realm File
display_name: Realm File
optional: true

- command: shell.exec
Expand Down Expand Up @@ -515,7 +515,7 @@ functions:
set -o verbose
TOP_DIR=$(pwd)
HANG_ANALYZER_PATH=$TOP_DIR/evergreen/hang_analyzer
REQUIREMENTS_PATH=$HANG_ANALYZER_PATH/requirements.txt
Expand Down Expand Up @@ -1166,7 +1166,7 @@ tasks:
./build/test/${cmake_build_type|Debug}-iphonesimulator/realm-combined-tests.app \
'io.realm.CombinedTests' \
$TEST_RESULTS_FILE
- name: generate-sync-corpus
tags: [ "for_nightly_tests" ]
exec_timeout_secs: 1800
Expand Down Expand Up @@ -1393,6 +1393,19 @@ buildvariants:
- name: compile_test
- name: lint

- name: ubuntu-cpp20
display_name: "Ubuntu C++20"
run_on: ubuntu2404-arm64-large
expansions:
fetch_missing_dependencies: On
c_compiler: "/opt/clang+llvm/bin/clang"
cxx_compiler: "/opt/clang+llvm/bin/clang++"
clang_format: "/opt/clang+llvm/bin/clang-format"
extra_flags: -DCMAKE_CXX_STANDARD=20
tasks:
- name: compile_test
- name: lint

- name: ubuntu-no-session-multiplexing
display_name: "Ubuntu (Sync Multiplexing Disabled)"
run_on: ubuntu2204-arm64-large
Expand Down Expand Up @@ -1469,7 +1482,7 @@ buildvariants:
fetch_missing_dependencies: On
c_compiler: "/opt/clang+llvm/bin/clang"
cxx_compiler: "/opt/clang+llvm/bin/clang++"
run_with_encryption: 1
run_with_encryption: 1
enable_asan: On
cmake_build_type: RelWithDebInfo
tasks:
Expand All @@ -1492,7 +1505,7 @@ buildvariants:
cxx_compiler: "./clang_binaries/bin/clang++"
python3: /opt/mongodbtoolchain/v3/bin/python3
tasks:
- name: compile_test_and_package
- name: compile_test_and_package
- name: benchmarks
- name: generate-sync-corpus

Expand Down Expand Up @@ -1979,5 +1992,3 @@ buildvariants:
# no_tests: On
# tasks:
# - name: compile_only


4 changes: 2 additions & 2 deletions src/external/bson/bson-decimal128.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ _mul_64x64 (uint64_t left, /* IN */
* Returns:
* The lowercased character.
*/
char
static char
_dec128_tolower (char c)
{
if (isupper (c)) {
Expand All @@ -395,7 +395,7 @@ _dec128_tolower (char c)
* Returns:
* true if the strings are equal, false otherwise.
*/
bool
static bool
_dec128_istreq (const char *a, /* IN */
const char *b /* IN */)
{
Expand Down
2 changes: 1 addition & 1 deletion src/external/bson/bson-iter.c
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ _bson_iter_next_internal (bson_iter_t *iter, /* INOUT */
subtype = *(iter->raw + iter->d2);

if (subtype == BSON_SUBTYPE_BINARY_DEPRECATED) {
int32_t binary_len;
uint32_t binary_len;

if (l < 4) {
iter->err_off = o;
Expand Down
2 changes: 1 addition & 1 deletion src/realm/object-store/c_api/sync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,7 @@ RLM_API void realm_sync_session_handle_error_for_testing(const realm_sync_sessio
REALM_ASSERT(session);
SyncSession::OnlyForTesting::handle_error(
*session->get(),
sync::SessionErrorInfo{Status{static_cast<ErrorCodes::Error>(error_code), error_str}, !is_fatal});
sync::SessionErrorInfo{Status{static_cast<ErrorCodes::Error>(error_code), error_str}, is_fatal});
}

} // namespace realm::c_api
3 changes: 1 addition & 2 deletions src/realm/object-store/sync/sync_session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -912,8 +912,7 @@ void SyncSession::create_sync_session()
session_config.proxy_config = sync_config.proxy_config;
session_config.simulate_integration_error = sync_config.simulate_integration_error;
session_config.flx_bootstrap_batch_size_bytes = sync_config.flx_bootstrap_batch_size_bytes;
session_config.session_reason =
client_reset::is_fresh_path(m_config.path) ? sync::SessionReason::ClientReset : sync::SessionReason::Sync;
session_config.fresh_realm_download = client_reset::is_fresh_path(m_config.path);
session_config.schema_version = m_config.schema_version;

if (sync_config.on_sync_client_event_hook) {
Expand Down
15 changes: 14 additions & 1 deletion src/realm/sync/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ class SessionWrapper final : public util::AtomicRefCountBase, DB::CommitListener

const SessionReason m_session_reason;

// If false, QUERY and MARK messages are allowed but UPLOAD messages will not
// be sent to the server.
const bool m_allow_upload_messages;

const uint64_t m_schema_version;

std::shared_ptr<SubscriptionStore> m_flx_subscription_store;
Expand Down Expand Up @@ -716,6 +720,13 @@ uint64_t SessionImpl::get_schema_version() noexcept
return m_wrapper.m_schema_version;
}

bool SessionImpl::upload_messages_allowed() noexcept
{
// Can only be called if the session is active or being activated
REALM_ASSERT_EX(m_state == State::Active || m_state == State::Unactivated, m_state);
return m_wrapper.m_allow_upload_messages;
}

void SessionImpl::initiate_integrate_changesets(std::uint_fast64_t downloadable_bytes, DownloadBatchState batch_state,
const SyncProgress& progress, const ReceivedChangesets& changesets)
{
Expand Down Expand Up @@ -1150,7 +1161,9 @@ SessionWrapper::SessionWrapper(ClientImpl& client, DBRef db, std::shared_ptr<Sub
, m_progress_handler(std::move(config.progress_handler))
, m_connection_state_change_listener(std::move(config.connection_state_change_listener))
, m_debug_hook(std::move(config.on_sync_client_event_hook))
, m_session_reason(m_client_reset_config ? SessionReason::ClientReset : config.session_reason)
, m_session_reason(m_client_reset_config || config.fresh_realm_download ? SessionReason::ClientReset
: SessionReason::Sync)
, m_allow_upload_messages(!config.fresh_realm_download)
, m_schema_version(config.schema_version)
, m_flx_subscription_store(std::move(flx_sub_store))
, m_migration_store(std::move(migration_store))
Expand Down
6 changes: 3 additions & 3 deletions src/realm/sync/client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -420,9 +420,9 @@ class Session {
/// through Client::run().
util::UniqueFunction<ConnectionStateChangeListener> connection_state_change_listener;

/// The purpose of this sync session. Reported to the server for informational purposes and has no functional
/// effect.
SessionReason session_reason = SessionReason::Sync;
/// Is this session being opened for a realm whose path ends in ".fresh"? If so,
/// it will be downloading a fresh copy of the realm data from the server.
bool fresh_realm_download = false;

/// Schema version
///
Expand Down
1 change: 1 addition & 0 deletions src/realm/sync/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ enum class SyncClientHookEvent {
BindMessageSent,
ClientResetMergeComplete,
BootstrapBatchAboutToProcess,
UploadMessageSent,
};

enum class SyncClientHookAction {
Expand Down
Loading

0 comments on commit cbc571b

Please sign in to comment.