Fluid Framework support full page refresh on context reload
If possible, it might be nice if the host isolated only the runtime in an iframe, so that reload do cleanup easily without losing the Container. If this is not feasible, it would still be good for the Fluid Framework to support full page refresh on context reload.
Currently it is not possible, because the old code will be loaded again, and the reload will happen again which would cause a loop.
Option 1: All clients block until summary ack
If the host/app/components prefer to do a full page refresh after a code proposal version upgrade, they need to block until the summarizer client sees the code proposal has been accepted, and then submits a summary which is acked. This will prevent the clients from going through the proposal again and needing a refresh again (cycle). It is important to make sure that we do not get stuck blocking forever- i.e. the summarize needs to succeed.
This option maximally leverages existing functionality and behavior.
Option 2: Container sniffs ops and loads latest code
Alternatively, the solution could be to provide some exposed info to the code loader or the code provider (if it is a shim) that would allow it to load the latest code proposal in the op stream rather than directly from the summary, and then bypass the code acceptance reload.
This may increase the critical path, since it requires the Container to connect to delta stream and scan ops before loading the code. To mitigate this, it should be opt-in via a local storage flag or something.
Option 3: All clients race to summarize
Context reload already does an in-memory summary which is passed to the new runtime. Instead of keeping this summary in-memory, it could be an actual summary which is posted. Once any summary ack is seen (with ref seq > code proposal accepted seq), then all clients are free to refresh. After refreshing, they will be loading from the latest code.
This method would pair with a change to have the summary that is created during reload be a "fast" or minimal work summary. The snapshot would just be a pointer to the previous summary + a blob of the outstanding ops (quorum is server side, so that is fine). This should increase speed at which the summary is created and decrease likelihood of failure. It also makes it possible for summaries to be generated on "live" containers (vs. the separate summarizer container).
As a side-effect, there would likely be a blast of summary nack ops for all clients who didn't win the race to summarize.
Design change update: Instead of always reloading context on "code" update, instead only reload if incompatible version. Additionally, actual loaded code may be sliding window which can sidestep reload page problem: i.e. schema v1 -> schema v2 upgrade, when v2 code is available it will load that code even if schema v1 is specified, but then it will not need to refresh once it sees the v2 accepted, so we avoid the loop.
this is related to #3478
@arinwt is this different from #1309
No it isn't different anymore. Originally it was to track some of the work you have been doing: the API for the host to refresh the page, etc. This was the earlier issue so it had more ideas in it before we had settled on race to summarize.