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

Replace copyContainer with viewContainerVersion #20779

Merged
merged 14 commits into from
May 2, 2024

Conversation

ChumpChief
Copy link
Contributor

@ChumpChief ChumpChief commented Apr 22, 2024

The copyContainer API did not properly handle scenarios where the sequenceNumber from the old container was present in the summary that was used to establish the new container. In this case, the document was corrupted due to a "sequenceNumber from the future" breaking expectations. In 2.0, there is additionally an assert that blocks attempting the copy altogether (added in #17706).

This PR moves away from the copyContainer approach in favor of just loading the historic version for viewing - the customer can then decide what to do with the data. Most likely usage pattern would be:

  1. Load the version for viewing
  2. Create a new container with the same schema
  3. Iterate over the old container's data, writing it into the new container
  4. Attach the new container

AB#6411
AB#7712

@github-actions github-actions bot added base: main PRs targeted against main branch public api change Changes to a public API labels Apr 22, 2024
@msfluid-bot
Copy link
Collaborator

msfluid-bot commented Apr 30, 2024

@fluid-example/bundle-size-tests: -104 Bytes
Metric NameBaseline SizeCompare SizeSize Diff
aqueduct.js 454.11 KB 454.11 KB No change
azureClient.js 550.72 KB 550.62 KB -104 Bytes
connectionState.js 680 Bytes 680 Bytes No change
containerRuntime.js 257.28 KB 257.28 KB No change
fluidFramework.js 344.3 KB 344.3 KB No change
loader.js 133.19 KB 133.19 KB No change
map.js 41.44 KB 41.44 KB No change
matrix.js 143.52 KB 143.52 KB No change
odspClient.js 519.1 KB 519.1 KB No change
odspDriver.js 97.52 KB 97.52 KB No change
odspPrefetchSnapshot.js 42.39 KB 42.39 KB No change
sharedString.js 161.25 KB 161.25 KB No change
sharedTree.js 344.29 KB 344.29 KB No change
Total Size 3.17 MB 3.17 MB -104 Bytes

Baseline commit: eda9e6d

Generated by 🚫 dangerJS against 8b521e4

Copy link
Contributor

@scottn12 scottn12 left a comment

Choose a reason for hiding this comment

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

LGTM!

id: string,
containerSchema: TContainerSchema,
version: AzureContainerVersion,

Choose a reason for hiding this comment

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

Is "version" being used at all?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call, I accidentally broke it when switching to the new API in the last commit. Fixed in latest.

@sashasimic
Copy link

@ChumpChief were you able to validate full recovery flow?

Also please open the ADO item that tracks work needed to updated service docs showing the recovery workflow. Maybe we need to chat with them how their docs are distinguishing 1.x and 2.x scenarios.

@@ -0,0 +1,8 @@
---
"@fluidframework/azure-client": minor

Choose a reason for hiding this comment

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

Would this be a major change?

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 believe @tylerbutler 's guidance was to just leave as minor since we don't use changeset to version our packages.

@ChumpChief
Copy link
Contributor Author

ChumpChief commented May 2, 2024

@ChumpChief were you able to validate full recovery flow?

Yes, I did manual verification that I could get versions, use the new API to load from those versions, and retrieve the data (and that the data was in the prior state). EDIT: Also just retested this using the new loadContainerPaused API and confirmed it's all still working as expected.

Also please open the ADO item that tracks work needed to updated service docs showing the recovery workflow. Maybe we need to chat with them how their docs are distinguishing 1.x and 2.x scenarios.

Opened AB#7917

@ChumpChief ChumpChief merged commit ecfb44d into microsoft:main May 2, 2024
30 checks passed
@ChumpChief ChumpChief deleted the LoadFrozen branch May 2, 2024 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

4 participants