Skip to content

[ConfigNode] Revert procedure-based RegionGroup cleanup and fix RegionMaintainer retries - #18404

Merged
CRZbulabula merged 3 commits into
masterfrom
yongzao/revert-region-replica-procedure
Aug 5, 2026
Merged

[ConfigNode] Revert procedure-based RegionGroup cleanup and fix RegionMaintainer retries#18404
CRZbulabula merged 3 commits into
masterfrom
yongzao/revert-region-replica-procedure

Conversation

@CRZbulabula

@CRZbulabula CRZbulabula commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Description

This PR reverts the procedure-based RegionGroup cleanup introduced by #18033 and its follow-up fix #18097, while keeping the restored RegionMaintainer flow safe when a successful DataNode RPC response is lost.

With the release approaching, this change returns Region replica maintenance to the previous implementation instead of shipping the new procedure flow without enough time for further stabilization.

The revert:

  • restores create and delete task handling in PartitionManager.maintainRegionReplicas();
  • removes RemoveRegionGroupProcedure, its state, serialization registration, and tests;
  • restores the previous cleanup paths in CreateRegionGroupsProcedure and DeleteDatabaseProcedure;
  • restores the previous RegionMaintainer queue and DataNode delete-task behavior;
  • preserves unrelated changes merged after the original commits, including i18n, subscription procedure registration, metrics, and file API updates;
  • removes i18n constants that became unused after the revert.

The RegionMaintainer compatibility fix:

  • adds explicit REGION_ALREADY_EXISTS and REGION_NOT_EXIST statuses;
  • makes DataNode CREATE distinguish a newly created Region, an already-created Region, and a real failure;
  • makes DataNode REMOVE return SUCCESS_STATUS when this request performed any required deletion, and REGION_NOT_EXIST only when both the consensus group and local Region were already absent;
  • propagates DataRegion deletion failures instead of reporting generic success;
  • lets ConfigNode complete CREATE tasks on SUCCESS_STATUS or REGION_ALREADY_EXISTS, and DELETE tasks on SUCCESS_STATUS or REGION_NOT_EXIST.

This prevents RegionMaintain tasks from retrying forever when CREATE or REMOVE completed on the DataNode but the corresponding 200 response did not reach the ConfigNode.

Compatibility note

This revert removes procedure type 207 and the DELETE_DATABASE_CONFIG state added by #18033. A cluster that has already run a build containing #18033 should ensure that no RemoveRegionGroupProcedure or affected DeleteDatabaseProcedure remains persisted or in flight before switching to a build containing this revert. Mixed-version rolling rollback is not recommended.

This PR also adds internal status codes 911 and 912 for Region maintenance. ConfigNodes and DataNodes should use the same build during this rollback.

Tests

  • mvn spotless:apply -pl iotdb-client/service-rpc,iotdb-core/datanode,iotdb-core/confignode
  • mvn test-compile -pl iotdb-client/service-rpc,iotdb-core/datanode,iotdb-core/confignode -am -DskipTests
  • mvn test-compile -pl iotdb-client/service-rpc,iotdb-core/datanode,iotdb-core/confignode -am -P with-zh-locale -DskipTests
  • mvn test -pl iotdb-core/confignode -am -Dtest=PartitionManagerRegionMaintainTest -Dsurefire.failIfNoSpecifiedTests=false
  • mvn test -pl iotdb-core/confignode -Dtest=PartitionInfoTest

@CRZbulabula CRZbulabula changed the title [ConfigNode] Revert procedure-based RegionGroup cleanup [ConfigNode] Revert procedure-based RegionGroup cleanup and fix RegionMaintainer retries Aug 5, 2026
@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 11.52074% with 192 lines in your changes missing coverage. Please review.
✅ Project coverage is 43.51%. Comparing base (f6a844d) to head (6d49bcb).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
...confignode/manager/partition/PartitionManager.java 3.78% 127 Missing ⚠️
...procedure/impl/schema/DeleteDatabaseProcedure.java 0.00% 47 Missing ⚠️
...db/protocol/thrift/impl/DataNodeRegionManager.java 44.44% 5 Missing ⚠️
...ol/thrift/impl/DataNodeInternalRPCServiceImpl.java 63.63% 4 Missing ⚠️
...edure/impl/region/CreateRegionGroupsProcedure.java 0.00% 3 Missing ⚠️
...sync/CnToDnInternalServiceAsyncRequestManager.java 0.00% 2 Missing ⚠️
...che/iotdb/confignode/manager/ProcedureManager.java 0.00% 2 Missing ⚠️
...g/apache/iotdb/db/storageengine/StorageEngine.java 50.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #18404      +/-   ##
============================================
+ Coverage     43.49%   43.51%   +0.02%     
  Complexity      374      374              
============================================
  Files          5394     5393       -1     
  Lines        385391   385493     +102     
  Branches      50148    50169      +21     
============================================
+ Hits         167624   167760     +136     
+ Misses       217767   217733      -34     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@CRZbulabula
CRZbulabula merged commit a0543f5 into master Aug 5, 2026
41 of 42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant