Skip to content

Conversation

@hongzhi-gao
Copy link
Contributor

@hongzhi-gao hongzhi-gao commented Nov 26, 2025

Description

  1. FolderManager relocated to commons module for consensus module accessibility.

img_v3_02sl_2c9a9abc-2110-482d-a770-5f9717ee5f5g


This PR has:

  • been self-reviewed.
    • concurrent read
    • concurrent write
    • concurrent read and write
  • added documentation for new or modified features or behaviors.
  • added Javadocs for most classes and all non-trivial methods.
  • added or updated version, license, or notice information
  • added comments explaining the "why" and the intent of the code wherever would not be obvious
    for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold
    for code coverage.
  • added integration tests.
  • been tested in a test IoTDB cluster.

Key changed/added classes (or packages if there are too many classes) in this PR

Comment on lines 344 to 345
// debug print the path of consensus dir
System.out.println(file.getAbsolutePath());
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed

Comment on lines 543 to 481
@Override
public String getRegionDirFromConsensusGroupId(ConsensusGroupId groupId) {
return buildPeerDir(storageDir, groupId);
return null;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Explain this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed

Comment on lines 116 to 137
public String getFolderByHashId(int hashId) throws DiskSpaceInsufficientException {
if (folders.isEmpty()) {
throw new DiskSpaceInsufficientException(folders);
}

List<String> healthyFolders =
folders.stream()
.filter(
folder ->
foldersStates.getOrDefault(folder, FolderState.ABNORMAL) == FolderState.HEALTHY)
.collect(Collectors.toList());

if (healthyFolders.isEmpty()) {
logger.error("No healthy folders available, change system mode to read-only.");
CommonDescriptor.getInstance().getConfig().setNodeStatus(NodeStatus.ReadOnly);
CommonDescriptor.getInstance().getConfig().setStatusReason(NodeStatus.DISK_FULL);
throw new DiskSpaceInsufficientException(folders);
}

int index = Math.abs(hashId) % healthyFolders.size();
return healthyFolders.get(index);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

If the healthy status of the folders changes, then the same region will be distributed to different folders, and the judgement below will also be invalid?
image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed

@jt2594838
Copy link
Contributor

Should include some compatibility design, like adding storageDir to storageDirs.

# Conflicts:
#	iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/protocol/thrift/IoTDBDataNodeReceiver.java
#	iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/util/LoadUtil.java
@hongzhi-gao hongzhi-gao force-pushed the feature/iotconsensus-snap-multi-dir branch from 85037c6 to 7f86ba6 Compare December 4, 2025 09:58
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