Skip to content

Commit fd676e1

Browse files
arp7elek
authored andcommitted
HDDS-1426. Minor logging improvements for MiniOzoneChaosCluster
Closes #730
1 parent 3b08ac4 commit fd676e1

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

hadoop-ozone/integration-test/src/test/bin/start-chaos.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717

18-
date=`date +"%m-%d-%y-%T"`
18+
date=`date +"%Y-%m-%d--%H-%M-%S-%Z"`
1919
fileformat=".MiniOzoneChaosCluster.log"
2020
heapformat=".dump"
2121
current="/tmp/"

hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/MiniOzoneChaosCluster.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,15 @@ private int getNodeToFail() {
8787
}
8888

8989
private void failNodes() {
90-
for (int i = 0; i < getNumberOfNodesToFail(); i++) {
90+
final int numNodesToFail = getNumberOfNodesToFail();
91+
LOG.info("Will restart {} nodes to simulate failure", numNodesToFail);
92+
for (int i = 0; i < numNodesToFail; i++) {
9193
boolean failureMode = isFastRestart();
9294
int failedNodeIndex = getNodeToFail();
9395
try {
96+
LOG.info("Restarting DataNodeIndex {}", failedNodeIndex);
9497
restartHddsDatanode(failedNodeIndex, failureMode);
98+
LOG.info("Completed restarting DataNodeIndex {}", failedNodeIndex);
9599
} catch (Exception e) {
96100

97101
}
@@ -118,7 +122,8 @@ private void fail() {
118122
}
119123

120124
void startChaos(long initialDelay, long period, TimeUnit timeUnit) {
121-
LOG.info("Starting Chaos with failure period:{} unit:{}", period, timeUnit);
125+
LOG.info("Starting Chaos with failure period:{} unit:{} numDataNodes:{}",
126+
period, timeUnit, numDatanodes);
122127
scheduledFuture = executorService.scheduleAtFixedRate(this::fail,
123128
initialDelay, period, timeUnit);
124129
}

0 commit comments

Comments
 (0)