(tree) Fix incremental summary stale handle paths#26990
(tree) Fix incremental summary stale handle paths#26990agarwal-navin wants to merge 5 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes incremental summary handle paths becoming stale when ancestor chunks are re-encoded with new referenceIds by changing chunk tracking to store parentReferenceId and computing handle paths on demand from the latest summary’s tracking map.
Changes:
- Replaced stored chunk
summaryPathstrings withparentReferenceId-based tracking and added on-demand handle-path computation via parent-chain traversal. - Updated chunk loading/decoding to persist
parentReferenceIdrather than parsing/storing path strings. - Expanded
ForestSummarizertests with parameterized scenarios covering repeated-depth and copy-propagation stale-handle cases; adjusted handle-path validation to allow chained handles.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/dds/tree/src/feature-libraries/forest-summary/incrementalSummaryBuilder.ts | Switches tracking from path strings to parent reference IDs and computes handle paths by walking the latest-summary parent chain. |
| packages/dds/tree/src/test/feature-libraries/forest-summary/forestSummarizer.spec.ts | Adds targeted regression tests for stale handle paths and relaxes validation for chained-handle cases. |
|
This seems like it could impact users, so it should have a changeset. It seems like this bug could have corrupted documents: we should document in a user facing way (the changeset) what the symptoms of this corruption would be and in what cases they might have occurred. Ideally we should also note how people can recover (I guess just roll back to an earlier version of the document?). Might be worth calling out https://fluidframework.com/docs/api/fluid-framework/#foresttypeexpensivedebug-variable as way to validate a given document is not corrupted such that it's out of schema. |
…ntalSummaryBuilder.ts Co-authored-by: Copilot <[email protected]>
…ntalSummaryBuilder.ts Co-authored-by: Copilot <[email protected]>
Added a changeset. The document corruption will not happen because an incorrect summary was uploaded because summary upload would fail. What may result in document corruption is multiple falied summaries leading to ops accumulation which can reach a threshold after which service will reject future ops. |
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Bug
When a parent incremental chunk was re-encoded with a new
referenceId, child chunks that became handles still held asummaryPathstring referencing the oldreferenceId. On the next summary, those handle URLs pointed to keys that no longer existed in the preceding summary tree.Fix
Replaced
summaryPath: stringinChunkSummaryPropertiesandChunkLoadPropertieswithparentReferenceId: ChunkReferenceId | undefined. The full handle path is now computed on demand by walking up the parent chain vialatestSummaryRefIdMap— aMap<ChunkReferenceId, ChunkSummaryProperties>built at the start of each summary and scoped toTrackedSummaryProperties. This keeps every entry correct regardless of ancestor re-encodings.Tests
Added parameterized test cases covering the stale-path scenarios (
[1,1],[2,2],[1,0,1],[2,0,2], etc.), a multi-handle test (simultaneous handles at depth 3 and 4), and afullTree=truetest.🤖 Generated with Claude Code