Skip to content

[IOTDB-4340] Refactor Region migration related interfaces#7243

Merged
Beyyes merged 1 commit intoapache:masterfrom
CRZbulabula:Refactor_Region_migration_related_interfaces
Sep 7, 2022
Merged

[IOTDB-4340] Refactor Region migration related interfaces#7243
Beyyes merged 1 commit intoapache:masterfrom
CRZbulabula:Refactor_Region_migration_related_interfaces

Conversation

@CRZbulabula
Copy link
Copy Markdown
Contributor

@CRZbulabula CRZbulabula commented Sep 6, 2022

In order to make the RegionMigration process more understandable, I finished the following refactor:

  1. The RegionMigration process is splited into four steps: CREATE_NEW_REGION_PEER(create a new RegionReplica on a specified DataNode and make it join in the Region ConsensusGroup), ADD_REGION_PEER(let one of any Region peer except the new one to process add peer), REMOVE_REGION_PEER(let one of any Region peer except the origin one to process remove peer), DELETE_OLD_REGION_PEER(let the DataNode that contains the origin RegionReplica to quit the ConsensusGroup and clean all of data). You can see the DataNode remove process doc for more details.
  2. Rename TMigrateRegionReq to TMaintainPeerReq, which only contains the selected DataNodeLocation(will perform the specified process) and the corresponding RegionId.
  3. Add and modify some annotations.

I also process a simple test on my local machine:

  1. I first start a 1C3D environment, where both the SchemaRegion consensus protocol and the DataRegion consensus protocol are Ratis, and the SchemaReplicationFactor and DataReplicationFactor are 3.

image

  1. Then I create a SchemaRegionGroup and a DataRegionGroup.

image

  1. Next, I add another DataNode.

image

  1. Finally, I start the remove DataNode process, and success.

image

image

image

Copy link
Copy Markdown
Member

@Beyyes Beyyes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add 1 replica remove-datanode test

@CRZbulabula
Copy link
Copy Markdown
Contributor Author

add 1 replica remove-datanode test

I've tested and found that my PR can't solve this problem (>_<).

@Beyyes Beyyes merged commit 0f0816e into apache:master Sep 7, 2022
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.

2 participants