MatrixOne v26.4.0.0-rc2 Release Notes¶
Release Date: July 9, 2026 MatrixOne Version: v26.4.0.0-rc2
MatrixOne 4.0.0-rc2 is a patch release that follows v4.0.0-rc1. It fixes several bugs introduced in rc1, including the SET SECONDARY ROLE ALL behavior that was incorrectly switching the primary role, and improves role rewrite rule validation. It also introduces a new system variable sort_spill_mem for controlling merge-order spill memory.
New Features¶
System Variable: sort_spill_mem¶
A new system variable sort_spill_mem controls the memory limit for sort spill operations during merge-order execution. When sort operations exceed the configured memory threshold, intermediate data is spilled to disk.
Scope: Global and Session
Dynamic: Yes
Type: Integer (bytes)
Default: 0 (disabled — no spill limit)
Range: 0 to 1099511627776 bytes (1 TiB)
Set it with SET sort_spill_mem = <bytes>; to enable spill for large sort operations. A value of 0 disables the limit.
Behavior Changes¶
SET SECONDARY ROLE Fix: Primary Role Preservation¶
Bug fix / behavior change. In v4.0.0-rc1, SET SECONDARY ROLE ALL was incorrectly switching the user’s primary role to the role with the smallest role_id. This has been fixed: the primary role is now correctly preserved when enabling secondary roles.
Additionally, SET SECONDARY ROLE ALL, SET SECONDARY ROLE NONE, and SET ROLE now properly invalidate the privilege cache and the rule cache on execution, ensuring that role changes take effect immediately without requiring a session reconnect.
Role Rewrite Rule Validation Improvements¶
Behavior change. ALTER ROLE ADD RULE now validates the rule SQL before any catalog write. Previously, validation occurred but could leave stale catalog entries in edge cases. The improved flow rejects invalid rules immediately:
Syntax errors return
invalid rewrite rule SQL.Non-SELECT statements (e.g.,
DELETE,INSERT) returnonly accept SELECT-like statements as rewrites.Empty rules return
rewrite rule SQL is empty.
The existing rule is never overwritten on validation failure.
Role Rewrite Rule Cache Invalidation on Role Switch¶
SET SECONDARY ROLE ALL, SET SECONDARY ROLE NONE, and SET ROLE now invalidate the rule cache. Previously, switching roles did not clear the cached rewrite rules, which could cause stale rules to apply. The rule cache is now properly invalidated on every role change.
Bug Fixes¶
POSITION(substr IN str) Parser Fix (#24776)¶
Fixed a parser issue where the POSITION(substr IN str) syntax was not recognized in certain column-reference contexts (e.g., SELECT substr, str, POSITION(substr IN str) AS position FROM t1). The syntax was already documented as a LOCATE() synonym; this fix ensures it works in all valid SQL contexts.
Decimal Division Truncation Fix (#24706)¶
Fixed an issue where decimal integer division could produce truncated instead of correctly rounded results. This aligns decimal division behavior with MySQL semantics.
Remote Variable Expression Folding Fix (#24801)¶
Fixed an issue where session variable expressions (e.g., @@sql_mode) were not properly folded to constants before remote execution. This caused incorrect behavior in distributed queries where local and remote nodes used different variable values. Session variables are now correctly folded before being sent to remote nodes.
CDC Pause State Alignment (#24805)¶
Fixed a CDC task lifecycle issue where the pause operation could skip the pausing intermediate state. A new pausing state has been added to the CDC state machine and mo_catalog.mo_cdc_task table. CDC tasks now transition through pausing before reaching paused, ensuring proper watermark flush and state consistency.
Restore Database: Skip Already Deleted Relations (#24747)¶
Fixed an issue where restoring a database could fail when it encountered relations that were already deleted, causing restore operations to abort unexpectedly.
Role Base Rule Cache Order Fix (#24393)¶
Fixed a non-deterministic ordering issue in role-based rule loading. The role discovery order now uses both created_time and role_id as sort keys to ensure deterministic rule priority across CN restart.
Alter Copy Index Backfill Memory Optimization (#24751)¶
Fixed excessive memory consumption during ALTER TABLE ... ALTER COPY operations with index backfill.
Alter Copy Add Primary Key Precheck (#24750)¶
Added a precheck for ALTER TABLE ... ALTER COPY when adding a primary key, preventing operations that would fail partway through due to duplicate key conflicts.
Merge Order Spill Implementation (#24785)¶
Implemented full spill-to-disk support for merge-order operations, allowing large sort and merge operations to complete by spilling intermediate results to disk instead of failing with out-of-memory errors. Controlled by the new sort_spill_mem system variable.
Transaction Operator Close on Wait Failure (#24788)¶
Fixed a resource leak where a transaction operator would not be properly closed on wait failure, potentially causing long-held locks.
Compatibility Notes¶
The
sort_spill_memsystem variable is new in this release with no MySQL equivalent.SET SECONDARY ROLE ALLbehavior has been corrected — if your application relied on the buggy behavior of switching primary roles, review your role management code.The CDC
pausingstate is a new intermediate state visible inmo_catalog.mo_cdc_task.
About This Document¶
This document is generated by the docs sync agent based on the MatrixOne source diff between v4.0.0-rc1 and v4.0.0-rc2, and reviewed by humans via pull request.
Full Changelog¶
For the complete list of changes between v4.0.0-rc1 and v4.0.0-rc2, see: https://github.com/matrixorigin/matrixone/compare/v4.0.0-rc1…v4.0.0-rc2