Recover documents with too many outstanding ops
This issue is to track the general work for getting a document to recover itself when there are too many outstanding ops.
ODSP will start nacking all ops from the client once it sees 5k+ ops without a summary. In order to reach that state, there is probably some other issue preventing summaries (opened issue #2075 to start using alerts to be more proactive to these error scenarios). However once whatever issue preventing summaries is resolved, we want the container to be able to successfully summarize to recover. It turns out there were several layers preventing this, so this issue can track that end goal, while other issues still exist for the specific problems.
If all else fails and we still have problems, we can explore having a node process connect to the doc and summarize, rather than relying on the normal client SummaryManager to spawn one.
Some progress so far:
- #643 - The summarizer client needs to try to summarize one more time before closing, thus outliving its parent container. This is important, because when constantly getting nacked, the parent container will disconnect too quickly.
- #1923 - When summarizer and main client both get the same clientId, this caused a lot of strange errors to occur (asserts, etc.).
- #1930 - If the summarizer client also gets disconnected from the main client's nacks, then it will disconnect before it can summarize.
- #1986 - The summarizer client wasn't respecting its
reconnect: falsesetting from the request header. This complicated existing issues since the summarizer client would try to reconnect as readonly. - #1995 - The main client gets nacked and reconnects too many times in rapid succession, causing the server to disconnect the entire web socket. The summarizer shares the same web socket as the main client, so it also gets disconnected before it has a chance to summarize. This will add a delay before retrying to hopefully avoid getting the web socket completely disconnected.
- PR #1893, #1838, #1810 - Resolves race conditions where the summarizer client might close itself before starting.
- PR #3650 - Resolves race condition where summarizer starts for reason of maxOps, but then does not wait for that summary attempt to finish when closing and normally doing lastSummary. Now it will await whatever summary attempt is happening, and start a lastSummary if one is not already happening. By not waiting for maxOps (or whatever already running summary is there), it will disconnect mid-summarize which will cause it to fail.
In the meantime, Push has given us a way to bypass this temporarily just to recover documents.
The IConnect can have a skipCanClientsSubmitOperations property set to true to recover documents. We can hack this in to the connect message when we need to recover a broken document.
FYI - @anthony-murphy
Removed hotpatch label, as this item is about tracking any new cases and making sure system works correctly, not about any specific recent accident that we need to track with hotpatch label.
With the latest changes, I was able to recover docs using our service-load node client. Will wait to close this until after it is confirmed to recover docs in browser clients.