Summarizer more resilient - handle acked summary with no SummaryAck op
There was a bug that caused a summary to be accepted by the server, but never send a SummaryAck message. In this case, the summarizer is not resilient enough to handle this case since it uses the op to determine the parent summary handle. All subsequent summary attempts will be nacked with something like:
Proposed parent summary "undefined" does not match actual parent summary "...".
There are a few possible solutions:
- Retry in "safe" mode. The proposed fix is to have a SummaryNack trigger a retry in "safe" mode. In this case it will try to summarize again with a safe flag passed which will try to reduce optimizations/chances for error. Currently the plan would be to call getVersions for the parent summary handle (and possibly set fullTree to true?). A possible later extension of this would be to add error codes to SummaryNacks and take different action based on the code; i.e. when the parent summary doesn't match, fetch the latest or restart the client.
- con: calling getVersions to get a different parent summary handle than the one we think it should be is suspicious, and reduces guarantee that the summarizer client state matches the parent handle
- Initialize the LatestSummaryAck.handle (in ContainerRuntime) using the version fetched during container load. We also need to make sure that certain summarize failure criteria will cause the summarizer client to restart. In this case, the restarted summarizer should always manage to get the correct parent handle, and have it be guaranteed in sync with the actual current state.
- con: requires a client restart to resolve this problem (should be infrequent though)
- con: as compared to solution (1), this only covers one specific case of failure
Related: I think we may need to change the scribe behavior to validate the proposed summary reference sequence number >= the current protocol sequence number of the scribe service. I get concerned that checking the parent summary handle is insufficient, especially when refreshing with getVersions. And regardless, it would be nice to be more sure the sequence number of the quorum snapshot matches that of the proposed summary.