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

Remove ability to reject reentrant ops #20621

Merged
merged 9 commits into from
Apr 20, 2024

Conversation

vladsud
Copy link
Contributor

@vladsud vladsud commented Apr 11, 2024

Remove failed experiment from repo.
It has been proven that pursuing this direction is not feasible / too expensive and does not provide good programming model.
While it does not close venue for some misuse, we have covered some aspects of it (properly tracking referenceSequence number / rebasing for ops sent via re-entrancy).
See https://dev.azure.com/fluidframework/internal/_workitems/edit/2322#12286846 for some details.

Key changes:

  1. Remove IContainerRuntimeOptions.enableOpReentryCheck and code associated with this option
  2. Remove ensureNoDataModelChanges() from API surfaces where it's safe. Some interfaces can be cleaned only in the future (due to N/N-1 compat promises)
  3. Instead of relying on DDS to use ensureNoDataModelChanges to catch re-entrnacy, runtime will call it from process(), thus casting wider net and also not requiring each DDS to do so.
    • the side-effect of it - it will not catch re-entrant local changes, but such changes should not be rebased, so that's Ok.

Please note that opReentrancy.spec.ts has plenty of test coverage here, including UTs like "Eventual consistency with op reentry..." that uses SharedString to validate proper rebasing happens when dealing with reentrancy.

@github-actions github-actions bot added area: dds Issues related to distributed data structures area: runtime Runtime related issues area: tests Tests to add, test infrastructure improvements, etc public api change Changes to a public API base: main PRs targeted against main branch labels Apr 11, 2024
@msfluid-bot
Copy link
Collaborator

msfluid-bot commented Apr 12, 2024

@fluid-example/bundle-size-tests: -2.95 KB
Metric NameBaseline SizeCompare SizeSize Diff
aqueduct.js 452.58 KB 451.85 KB -747 Bytes
azureClient.js 546.36 KB 545.63 KB -744 Bytes
connectionState.js 680 Bytes 680 Bytes No change
containerRuntime.js 255.77 KB 255.22 KB -559 Bytes
fluidFramework.js 339.69 KB 339.65 KB -45 Bytes
loader.js 130.18 KB 130.18 KB No change
map.js 41.35 KB 41.31 KB -45 Bytes
matrix.js 143.34 KB 143.29 KB -45 Bytes
odspClient.js 514.25 KB 513.53 KB -744 Bytes
odspDriver.js 97.06 KB 97.06 KB No change
odspPrefetchSnapshot.js 41.93 KB 41.93 KB No change
sharedString.js 161.11 KB 161.06 KB -45 Bytes
sharedTree.js 339.69 KB 339.65 KB -45 Bytes
Total Size 3.14 MB 3.14 MB -2.95 KB

Baseline commit: 35aacbd

Generated by 🚫 dangerJS against 6478ef9

vladsud added a commit that referenced this pull request Apr 12, 2024
…Loader in versioned tests (#20635)

An extraction from #20621

Reason for changes: These tests explode when I change interface between DDS & DataStore

These tests are not written correctly. They mix arbitrary version of DDS with the latest version of FluidDataStoreRuntime (through TestFluidObjectFactory). We never supported such mixes - version of DDS has to match version or data store!

Using matching TestFluidObjectFactory is easy, but then we start running into somewhat similar problem of mixing FluidDataStoreRuntime  & ContainerRuntime. We support only N/N-1 mixes here, and nothing more. So we have to use the version provided by test framework, thus you see some dance above CodeLoader to get right factory.

And while we are at it, it would be great for the test to use Loader version provided by test framework, not latest version.
This breaks for old versions as the way test is written it works only for latest structure of the document. Previously test framework was running a ton of combos, but most of them were actually the same, as even when it was supplied different versions of loader, we were using only latest version of loader. So, the right fix here - use loader version provided by framework but skip all the tests that use old version of the loader, thus getting same result, but with fewer iterations (and faster tests).

As part of fixing it, use proper back-compat compatible ways to get to entry points at loader & runtime layers.
@vladsud vladsud marked this pull request as ready for review April 13, 2024 06:55
@vladsud vladsud requested a review from a team April 13, 2024 06:55
vladsud added a commit that referenced this pull request Apr 16, 2024
…re, runtime, Loader in versioned tests (#20650)

An extraction from #20621

Reason for changes
These tests explode when I change interface between DDS & DataStore

Description
These tests are not written correctly. They mix arbitrary version of DDS with the latest version of FluidDataStoreRuntime (through TestFluidObjectFactory). We never supported such mixes - version of DDS has to match version or data store!

Using matching TestFluidObjectFactory is easy, but then we start running into somewhat similar problem of mixing FluidDataStoreRuntime & ContainerRuntime. We support only N/N-1 mixes here, and nothing more. So we have to use the version provided by test framework, thus you see some dance above CodeLoader to get right factory.

And while we are at it, it would be great for the test to use Loader version provided by test framework, not latest version.
This breaks for old versions as the way test is written it works only for latest structure of the document. Previously test framework was running a ton of combos, but most of them were actually the same, as even when it was supplied different versions of loader, we were using only latest version of loader. So, the right fix here - use loader version provided by framework but skip all the tests that use old version of the loader, thus getting same result, but with fewer iterations (and faster tests).

As part of fixing it, use proper back-compat compatible ways to get to entry points at loader & runtime layers.
…to RemoveEnableOpReentryCheck

# Conflicts:
#	packages/test/test-end-to-end-tests/src/test/deRehydrateContainerTests.spec.ts
@vladsud vladsud merged commit c9d1562 into microsoft:main Apr 20, 2024
30 checks passed
@vladsud vladsud deleted the RemoveEnableOpReentryCheck branch April 20, 2024 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: dds Issues related to distributed data structures area: runtime Runtime related issues area: tests Tests to add, test infrastructure improvements, etc base: main PRs targeted against main branch public api change Changes to a public API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants