FluidFramework icon indicating copy to clipboard operation
FluidFramework copied to clipboard

Remove getSnapsthotTree calls from summarizer

Open vladsud opened this issue 7 years ago • 2 comments

SPO implemented ability to reference existing blobs (from prior snapshots) in newly uploaded snapshots via "<tree ID>/<path within ID>" schema, in addition to using "<blob ID>" schema when referencing existing blobs. That means that (some) map can refer to prior blob via something like "bO1sBAAABAAAABgAAAA==/defaultComponent/<some map guid>/head"

This allows us to implement the following schema:

Runtime: Runtime stops tracking base IDs (search for summaryTracker.getBaseId() calls) in a sense that it does not need to propagate IDs after successful summary. Runtime still needs to track IDs when loading from snapshot and use them (instead of using that new boolean) as first summary would not have reference point (see more on discussion below) Instead it tracks boolean, and sets it on the tree (if blob needs to be reused).

R11S driver Calculates sha hashes whenever we write out tree and keeps map of tree path -> hash for all blobs in prior snapshot. When new uploadSummary() calls comes in, fill in missing blobs IDs for blobs that are reused based on path -> sha mapping from prior snapshot. Error if such mapping does not exist, but client thinks that it should. Note that ISummaryTree that we are uploading via uploadSummary() does not have parent handle, so driver would need to track prior handle (and assume its knowledge matches runtime, which feels a bit dangerous -maybe we should change that API to include one). Also we need to consider how this sequence would work for first summary from client. There are two choices: a) runtime keeps base IDs after loading from snapshot and uses them, insdead of using boolean to indicate reuse of blob. Driver does not need to do anything. b) runtime never tracks base IDs (tracks just boolean) and driver is responsible to keep a tree from initial load process. I think latter is proffered.

SPO driver Similar as above, but SPO does not need to track anything other than handle to prior / parent tree. Any time it sees that blob is reused, it recomputes a combination of handle ID / tree path and stores it in the tree to reference to reused blob.

vladsud avatar Nov 08 '19 17:11 vladsud

Assuming that makes sense, any chance Wes can own implementation, and Arin helping with providing more clarity / PRs / etc.? Thanks!

vladsud avatar Nov 08 '19 17:11 vladsud

During this change we can remove summaryTracker logic and use sequence number to detect changes at component/DDS level.

We will need to track the handle of the summary we loaded from along with initialSequenceNumber. Then we need to change refreshBaseSummary to track the latest acked handle along with the referenceSequenceNumber of that acked summary replacing the loaded from info.

It will be a simpler model to detect changes at the component or DDS level by comparing if their latest sequence number > the latest summary referenceSequenceNumber.

We should also get rid of the call to getVersions in ContainerRuntime.generateSummary(), once we are tracking the last acked handle, we can just send that.

arinwt avatar Nov 09 '19 01:11 arinwt