Skip to content

Improve msn comments#22339

Merged
tyler-cai-microsoft merged 4 commits into
microsoft:mainfrom
tyler-cai-microsoft:update-msn-proxy-comments
Aug 29, 2024
Merged

Improve msn comments#22339
tyler-cai-microsoft merged 4 commits into
microsoft:mainfrom
tyler-cai-microsoft:update-msn-proxy-comments

Conversation

@tyler-cai-microsoft
Copy link
Copy Markdown
Contributor

@tyler-cai-microsoft tyler-cai-microsoft commented Aug 28, 2024

There is no task associated with this.

Relevant reference PR: #20856

@agarwal-navin and I had an offline conversation about this comment, and it was hard to understand. I've now improved the comment for it to be easier to understand.

@github-actions github-actions Bot added area: runtime Runtime related issues base: main PRs targeted against main branch labels Aug 28, 2024
@msfluid-bot
Copy link
Copy Markdown
Collaborator

msfluid-bot commented Aug 29, 2024

@fluid-example/bundle-size-tests: +245 Bytes
Metric NameBaseline SizeCompare SizeSize Diff
aqueduct.js 459.99 KB 460.03 KB +35 Bytes
azureClient.js 558.04 KB 558.08 KB +49 Bytes
connectionState.js 680 Bytes 680 Bytes No change
containerRuntime.js 260.83 KB 260.84 KB +14 Bytes
fluidFramework.js 398.4 KB 398.41 KB +14 Bytes
loader.js 134.26 KB 134.28 KB +14 Bytes
map.js 42.3 KB 42.31 KB +7 Bytes
matrix.js 146.47 KB 146.48 KB +7 Bytes
odspClient.js 525.31 KB 525.36 KB +49 Bytes
odspDriver.js 97.72 KB 97.74 KB +21 Bytes
odspPrefetchSnapshot.js 42.78 KB 42.79 KB +14 Bytes
sharedString.js 163.18 KB 163.18 KB +7 Bytes
sharedTree.js 388.91 KB 388.92 KB +7 Bytes
Total Size 3.29 MB 3.29 MB +245 Bytes

Baseline commit: 6efb044

Generated by 🚫 dangerJS against 470a8a0


// Intercept to reduce minimum sequence number to the delta manager's minimum sequence number.
// Sequence numbers are not guaranteed to follow any sort of order. Re-entrancy is one of those situations
// Minimum sequence numbers are not guaranteed to follow any sort of order. Re-entrancy is one of those situations
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This comment is still misleading. It's incorrect to say that min seq# are not guaranteed to follow any sort of order. They do follow an order and are always increasing similar to sequence number.
The reason this is needed is because the runtime could be tracking ops in pending state manager whose min seq# is lower than delta manager's because delta manager knows nothing about these pending ops. Basically, container runtime's knowledge of min seq# can be different from delta managers. So, we need to modify the min seq# before sending these ops to the lower layers for correctness.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also, not sure what you mean by "Re-entrancy is one of those situations". This comment should expand on that. What scenario does re-entrancy create that would lead to updating the min seq # here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is not guaranteed, one of the op re-entrancy tests breaks when I tried to introduce this invariant that minimum sequence number is always increasing.

Copy link
Copy Markdown
Contributor Author

@tyler-cai-microsoft tyler-cai-microsoft Aug 29, 2024

Choose a reason for hiding this comment

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

Update, I added an assert to validate the invariant, it seems to hold, I was wrong. Updating the PR

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Okay, good. Irrespective, the statement min squence numbers are not guaranteed to follow order is incorrect. The server will always stamp them in order. The client may have some scenarios where it changes the order while processing but the invariant still holds. So, even if you don't have the assert, I would remove that generic statement :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@markfields fyi - I know you might be working in this area, so it's best you're informed of this part of the runtime.

Comment thread packages/runtime/container-runtime/src/containerRuntime.ts Outdated
Comment thread packages/runtime/container-runtime/src/deltaManagerProxies.ts Outdated
Comment thread packages/runtime/container-runtime/src/deltaManagerProxies.ts Outdated
@tyler-cai-microsoft tyler-cai-microsoft enabled auto-merge (squash) August 29, 2024 18:45
@tyler-cai-microsoft tyler-cai-microsoft merged commit 80f60d1 into microsoft:main Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: runtime Runtime related issues base: main PRs targeted against main branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants