Mark Gui created HDDS-6190:
------------------------------
Summary: Cleanup unnecessary datanode id path checks.
Key: HDDS-6190
URL: https://issues.apache.org/jira/browse/HDDS-6190
Project: Apache Ozone
Issue Type: Improvement
Reporter: Mark Gui
Assignee: Mark Gui
For now, if the config item "ozone.scm.datanode.id.dir" is not given, datanode
fall back to use "ozone.metadata.dirs". But there are several places to check
for null or empty idFilePath which is not neccessary since datanode will fail
early if "ozone.metadata.dirs"
is not configured.
BTW we found this by running CI in our own environment and hit a failure:
{code:java}
[ERROR] Tests run: 4, Failures: 1, Errors: 0, Skipped: 1, Time elapsed: 29.629
s <<< FAILURE! - in
org.apache.hadoop.ozone.container.common.TestDatanodeStateMachine[ERROR]
testDatanodeStateMachineWithInvalidConfiguration(org.apache.hadoop.ozone.container.common.TestDatanodeStateMachine)
Time elapsed: 18.4 s <<< FAILURE!java.lang.AssertionError:
expected:<SHUTDOWN> but was:<RUNNING> at
org.junit.Assert.fail(Assert.java:89) {code}
The case fails every time on the CI machine but passes every time on my own
laptop in Intellij IDEA.
Luckily, we found the cause:
{code:java}
2022-01-17 16:02:05,957 [Test Data Node State Machine Thread - 0] ERROR
datanode.InitDatanodeState
(InitDatanodeState.java:persistContainerDatanodeDetails(141)) - Writing to
/datanode.id failed /datanode.id (Read-only file system) {code}
For the test - TestDatanodeStateMachine, it considers "" to be an invalid
config for "ozone.scm.datanode.id.dir", and it put the datanode to a SHUTDOWN
state as expected but not at the write place. Actually it fails due to not
having the write privilege on the root directory not because of an invalid
config.
But in your CI env, we just run CI as root, so the datanode goes to a RUNNING
state and we hit the CI failure.
I think we could just remove the invalid "ozone.scm.datanode.id.dir" check for
an empty value and let it go the fallback way and all unnecessary checks should
be removed.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]