FluidFramework
FluidFramework copied to clipboard
Summarizer cancels pending ack timer too early
Recently there was an optimization added to clear the pending ack timer whenever the time difference between the latest op received and the most recent summaryOp exceeds the pending ack wait time (#5117).
The intention is that this only applies for the first wait (i.e. when we are waiting to start our first summary). I found that there can be some overlap causing it to prevent summarizer client from waiting normal time for ack.
- summarizer client submits summary op and starts waiting for ack
- random op comes in, and summarizer client sees timestamp diff as large (because it hasn't observed it's own summary op yet)
- it cancels pending ack timer, and stops waiting for summary ack
- because it "failed" to summarize, it retries immediately in "safe" mode
- it fetches latest summary from storage server for next summary attempt
Although this shouldn't cause any data corruption, it is problematic for a few reasons:
- It greatly increases chances of reentrancy (if possible) or any other problems caused by running summarizer code at the same time. This is because 2 things are now happening at the same time: we are expecting our summary ack op and will handle it, and we are asking the server for the latest summary handle and generating a summary with it. Very likely to bring forth any race conditions that might exist.
- It can increase summary nacks (because mismatching parent)
- It causes worse perf by downloading summary unnecessarily
- It adds extraneous telemetry bugs/etc. For example it incorrectly logs "MissingSummaryAckFoundByOps" and likely "HandleSummaryAckError", etc.