szetszwo commented on code in PR #8093:
URL: https://github.com/apache/ozone/pull/8093#discussion_r1998480817
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/ozoneimpl/OzoneContainer.java:
##########
@@ -484,6 +485,11 @@ public void start(String clusterId) throws IOException {
return;
}
+ DatanodeLayoutStorage layoutStorage
+ = new DatanodeLayoutStorage(config);
+ layoutStorage.setClusterId(clusterId);
+ layoutStorage.persistCurrentState();
Review Comment:
The VERSION file will be overwritten for each restart. Unfortunately, it is
the current behavior.
The correct behavior is that the VERSION file should
- be created when storage is formatted, and
- be overwritten when there is a layout change.
For the other cases, the VERSION file should not be changed, i.e. no
overwriting the file is needed.
Let change it separately.
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/states/endpoint/VersionEndpointTask.java:
##########
@@ -88,11 +87,6 @@ public EndpointStateMachine.EndPointStates call() throws
Exception {
// Check HddsVolumes
checkVolumeSet(ozoneContainer.getVolumeSet(), scmId, clusterId);
- DatanodeLayoutStorage layoutStorage
- = new DatanodeLayoutStorage(configuration);
- layoutStorage.setClusterId(clusterId);
- layoutStorage.persistCurrentState();
-
Review Comment:
Good catch on the bug! There are multiple SCM endpoints so the
`persistCurrentState()` is called multiple times for the same file.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]