-
Notifications
You must be signed in to change notification settings - Fork 547
Matrix: Enable rollback and local server stress #24604
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…to sm/matrix-stress
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request improves the SharedMatrix implementation by adding rollback support, updating the pending operations tracking to handle multiple pending operations, and introducing a fuzz testing framework to validate the matrix behavior under stress.
- Added rollback capabilities in SharedMatrix and updated the setCellCore method to handle rollback scenarios.
- Modified pending operation storage from a single value to arrays for better multi-operation tracking.
- Introduced a new fuzz testing framework and updated test configurations/package.json accordingly.
Reviewed Changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
packages/test/local-server-stress-tests/src/test/localServerStressOrderSequentially.spec.ts | Adjusted test skip settings for rollback scenarios. |
packages/test/local-server-stress-tests/src/test/localServerStress.spec.ts | Updated skip configuration to include additional test IDs. |
packages/test/local-server-stress-tests/src/ddsModels.ts | Added import for baseSharedMatrixModel to support matrix tests. |
packages/test/local-server-stress-tests/package.json | Added dependency and build/test configuration for matrix support. |
packages/dds/matrix/src/test/matrix.fuzz.spec.ts | Replaced custom fuzz model setup with baseSharedMatrixModel integration. |
packages/dds/matrix/src/test/index.ts | New export to expose the shared matrix test model. |
packages/dds/matrix/src/test/fuzz.ts | New file implementing the fuzz testing framework for SharedMatrix. |
packages/dds/matrix/src/permutationvector.ts | Inserted rollback check to prevent unnecessary handle allocation during rollback ops. |
packages/dds/matrix/src/matrix.ts | Updated rollback handling, pending op tracking, and added a dedicated rollback method. |
packages/dds/matrix/package.json | Updated package configuration to include internal test exports for the matrix module. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances the SharedMatrix implementation by introducing rollback support, improving pending operation tracking, and adding a fuzz testing framework.
- Implements a rollback mechanism in SharedMatrix with changes to setCellCore and sendSetCellOp.
- Updates the pending operation tracking by switching from a single number to an array of sequence numbers.
- Adds new fuzz tests and updates package configuration for local server stress testing.
Reviewed Changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
packages/test/local-server-stress-tests/src/test/localServerStressOrderSequentially.spec.ts | Adjusts test skip configuration for rollback stress tests. |
packages/test/local-server-stress-tests/src/test/localServerStress.spec.ts | Updates skip arrays for stress test cases. |
packages/test/local-server-stress-tests/src/ddsModels.ts | Adds import for baseSharedMatrixModel to support new fuzz tests. |
packages/test/local-server-stress-tests/package.json | Includes the matrix package and its build test in test configuration. |
packages/dds/matrix/src/test/matrix.fuzz.spec.ts | Refactors fuzz tests to use baseSharedMatrixModel. |
packages/dds/matrix/src/test/index.ts | Exports the new baseSharedMatrixModel for reuse in test suites. |
packages/dds/matrix/src/test/fuzz.ts | Introduces a comprehensive fuzz testing framework for SharedMatrix. |
packages/dds/matrix/src/permutationvector.ts | Wraps segment JSON maintenance in a rollback check. |
packages/dds/matrix/src/matrix.ts | Implements rollback support and updates pending operation handling via arrays. |
packages/dds/matrix/package.json | Updates internal test exports configuration for matrix testing. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
…to sm/matrix-stress
…to sm/matrix-stress-stFWW
9abbae7
to
effbd1c
Compare
…to sm/matrix-pending-array
effbd1c
to
daef1fb
Compare
This pull request introduces significant changes to the
SharedMatrix
implementation to improve handling of pending cell changes and rollback operations, updates related utility classes, and enhances testing. Below is a summary of the most important changes grouped by theme.Enhancements to
SharedMatrix
functionality:PendingCellChanges<T>
interface to track both local changes and the latest consensus value for a cell. This replaces the previous approach of tracking pending writes with a single number. (matrix.ts
, [1] [2]sendSetCellOp
method to returnPendingCellChanges<T>
instead of a singlelocalSeq
value, enabling more granular tracking of pending operations. (matrix.ts
, [1] [2]rollback
method to handle undoing operations, ensuring that the matrix state can revert to the previous value or consensus value when necessary. (matrix.ts
, packages/dds/matrix/src/matrix.tsR882-R922)Improvements to operation handling:
consensus
value is updated and remaining pending changes are managed appropriately. (matrix.ts
, [1] [2]adjustPosition
inPermutationVector
handles removed segments, allocating handles for rows/columns that may be reactivated during rollbacks. (permutationvector.ts
, [1] [2]Code cleanup and refactoring:
isLatestPendingWrite
method fromSharedMatrix
, as its functionality is now integrated into the improved pending changes tracking system. (matrix.ts
, packages/dds/matrix/src/matrix.tsL1109-L1137)PermutationVector
for handlingINSERT
andREMOVE
operations, including rollback scenarios. (permutationvector.ts
, [1] [2]Testing and dependencies:
@fluidframework/matrix
as a dependency in thelocal-server-stress-tests
package and integrated thebaseSharedMatrixModel
into the stress tests to ensure thorough validation of the updatedSharedMatrix
behavior. (package.json
, [1] [2]These changes collectively enhance the robustness and maintainability of the
SharedMatrix
component, particularly in scenarios involving concurrent edits, rollbacks, and acknowledgments.