d-wang-commit opened a new pull request, #19204:
URL: https://github.com/apache/iotdb/pull/19204

   ## Description
   
   ### Problem and fix
   
   `SET CONFIGURATION` applies the Leader's local configuration before 
forwarding the request to other nodes. If another ConfigNode rejects a 
RegionGroup policy in a mixed-version cluster, the statement can fail after the 
Leader has already changed its configuration and allocation behavior.
   
   For example, with ConfigNodes running different versions or builds:
   
   ```sql
   SET CONFIGURATION 'data_region_group_extension_policy'='PROACTIVE';
   ```
   
   Reject SchemaRegionGroup and DataRegionGroup policy updates before changing 
memory, configuration files, or broadcasting when any registered ConfigNode has 
a different version or build, or version information is unavailable. Repeating 
the current policy value performs the same check.
   
   The check is limited to these two policy parameters. DataNode versions do 
not participate, and internal follower application keeps its existing path.
   
   ### Tests
   
   - Added `ConfigManagerRegionGroupPolicyVersionTest` for Schema/Data policy 
rejection before memory/file changes and broadcast, repeated values, internal 
follower application, and unrelated configuration updates.
   - Added `NodeManagerVersionConsistencyTest` for ConfigNode version/build 
mismatches, missing or unknown metadata, matching versions, and ignoring 
DataNode/AINode versions.
   - Validation: 26 targeted unit tests passed with no failures or skips, 
including the existing `RegionGroupExtensionPolicyConfigTest` and 
`ConfigManagerRegionGroupPolicyReloadTest`. Full-reactor English and Chinese 
test compilation passed.
   - IT: no automated IT was added. Manual packaged 2CN+1DN checks used 
different real builds sharing the same version string. Policy changes and 
repeated values were rejected with the expected error, and both ConfigNodes' 
applied configuration and configuration files remained unchanged. After 
upgrading both ConfigNodes while retaining the older DataNode, both policies 
applied successfully. Unrelated configuration updates and reads/writes also 
succeeded.
   
   ### Side effects and risks
   
   Policy hot reload is deliberately blocked across ConfigNode build 
differences, including compatible builds and registered offline nodes with 
older metadata. Unknown version/build information also rejects the update.
   
   Version records are maintained during registration and restart, so 
concurrent upgrades can expose metadata timing windows. Subsequent file or RPC 
failures retain the existing consistency limitations. Normal reads and writes 
do not invoke the new check.
   
   <hr>
   
   This PR has:
   - [x] been self-reviewed.
   - [x] added unit tests to cover new code paths.
   - [x] been tested in a test IoTDB cluster.
   
   <hr>
   
   ##### Key changed/added classes (or packages if there are too many classes) 
in this PR
   
   - `ConfigManager`: perform policy-specific validation before applying 
configuration.
   - `NodeManager`: compare the version and build of every registered 
ConfigNode.
   - `ConfigNodeMessages`: provide the rejection message in English and Chinese.
   - `ConfigManagerRegionGroupPolicyVersionTest` and 
`NodeManagerVersionConsistencyTest`: cover the new validation paths and their 
scope.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to