Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public File getCurrentDir() {
*
* @return the version file path
*/
private File getVersionFile() {
public File getVersionFile() {
return new File(getCurrentDir(), STORAGE_FILE_VERSION);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ private OzoneManager(OzoneConfiguration conf) throws IOException,
ScmInfo scmInfo = getScmInfo(configuration);
if (!(scmInfo.getClusterId().equals(omStorage.getClusterID()) && scmInfo
.getScmId().equals(omStorage.getScmId()))) {
logVersionMismatch(conf, scmInfo);
throw new OMException("SCM version info mismatch.",
ResultCodes.SCM_VERSION_MISMATCH_ERROR);
}
Expand Down Expand Up @@ -480,6 +481,21 @@ private OzoneManager(OzoneConfiguration conf) throws IOException,
omState = State.INITIALIZED;
}

private void logVersionMismatch(OzoneConfiguration conf, ScmInfo scmInfo) {
InetSocketAddress scmBlockAddress =
getScmAddressForBlockClients(conf);
if (!scmInfo.getClusterId().equals(omStorage.getClusterID())) {
LOG.error("clusterId from {} is {}, but is {} in {}",
scmBlockAddress, scmInfo.getClusterId(),
omStorage.getClusterID(), omStorage.getVersionFile());
}
if (!scmInfo.getScmId().equals(omStorage.getScmId())) {
LOG.error("scmId from {} is {}, but is {} in {}",
scmBlockAddress, scmInfo.getScmId(),
omStorage.getScmId(), omStorage.getVersionFile());
}
}

/**
* Instantiate services which are dependent on the OM DB state.
* When OM state is reloaded, these services are re-initialized with the
Expand Down