-
Notifications
You must be signed in to change notification settings - Fork 511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HDDS-11503. Add Robot test to verify Container Balancer for EC containers. #7311
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
7e12cad
HDDS-11503. Add Robot test to verify Container Balancer for EC contai…
Daniilchik 475f28b
HDDS-11503. Add Robot test to verify Container Balancer for EC contai…
Daniilchik efd7df1
HDDS-11503. Add Robot test to verify Container Balancer for EC contai…
Daniilchik ff64806
HDDS-11503. Add Robot test to verify Container Balancer for EC contai…
Daniilchik 5975a48
Merge branch 'apache:master' into HDDS-11503
Daniilchik 91e84c9
HDDS-11503. Add Robot test to verify Container Balancer for EC contai…
Daniilchik f513011
HDDS-11503. Add Robot test to verify Container Balancer for EC contai…
Daniilchik 9a80e03
HDDS-11503. Add Robot test to verify Container Balancer for EC contai…
Daniilchik a171ab8
HDDS-11503. Add Robot test to verify Container Balancer for EC contai…
Daniilchik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
hadoop-ozone/dist/src/main/compose/ozone-balancer/test-ec.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env bash | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
#suite:balancer | ||
|
||
COMPOSE_DIR="$( cd "$( dirname "${BASH_SOURCE0}" )" >/dev/null 2>&1 && pwd )" | ||
export COMPOSE_DIR | ||
export OM_SERVICE_ID="om" | ||
export OM=om1 | ||
export SCM=scm1 | ||
export OZONE_REPLICATION_FACTOR=3 | ||
|
||
# shellcheck source=/dev/null | ||
source "$COMPOSE_DIR/../testlib.sh" | ||
|
||
start_docker_env | ||
execute_robot_test ${OM} -v REPLICATION:rs-3-2-1024k -v TYPE:EC -v KEYS:7 -v LOWER_LIMIT:1.5 -v UPPER_LIMIT:2.5 -N ozone-balancer-EC balancer/testBalancer.robot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
*** Settings *** | ||
Documentation Smoketest ozone cluster startup | ||
Library OperatingSystem | ||
Library String | ||
Library Collections | ||
Resource ../commonlib.robot | ||
Resource ../ozone-lib/shell.robot | ||
|
@@ -35,7 +36,7 @@ Prepare For Tests | |
Execute dd if=/dev/urandom of=/tmp/100mb bs=1048576 count=100 | ||
Run Keyword if '${SECURITY_ENABLED}' == 'true' Kinit test user testuser testuser.keytab | ||
Execute ozone sh volume create /${VOLUME} | ||
Execute ozone sh bucket create /${VOLUME}/${BUCKET} | ||
Execute ozone sh bucket create --replication ${REPLICATION} --type ${TYPE} /${VOLUME}/${BUCKET} | ||
|
||
|
||
Datanode In Maintenance Mode | ||
|
@@ -67,7 +68,7 @@ Run Container Balancer | |
Wait Finish Of Balancing | ||
${result} = Execute ozone admin containerbalancer status | ||
Should Contain ${result} ContainerBalancer is Running. | ||
Wait Until Keyword Succeeds 3min 10sec ContainerBalancer is Not Running | ||
Wait Until Keyword Succeeds 6min 10sec ContainerBalancer is Not Running | ||
Sleep 60000ms | ||
|
||
Verify Verbose Balancer Status | ||
|
@@ -111,7 +112,7 @@ Create Multiple Keys | |
${fileName} = Set Variable file-${INDEX}.txt | ||
${key} = Set Variable /${VOLUME}/${BUCKET}/${fileName} | ||
LOG ${fileName} | ||
Create Key ${key} ${file} | ||
Create Key ${key} ${file} --replication=${REPLICATION} --type=${TYPE} | ||
Key Should Match Local File ${key} ${file} | ||
END | ||
|
||
|
@@ -126,14 +127,14 @@ Get Uuid | |
|
||
Close All Containers | ||
FOR ${INDEX} IN RANGE 15 | ||
${container} = Execute ozone admin container list --state OPEN | jq -r 'select(.replicationConfig.replicationFactor == "THREE") | .containerID' | head -1 | ||
${container} = Execute ozone admin container list --state OPEN | jq -r 'select(.replicationConfig.data == 3) | .containerID' | head -1 | ||
EXIT FOR LOOP IF "${container}" == "${EMPTY}" | ||
${message} = Execute And Ignore Error ozone admin container close "${container}" | ||
Run Keyword If '${message}' != '${EMPTY}' Should Contain ${message} is in closing state | ||
${output} = Execute ozone admin container info "${container}" | ||
Should contain ${output} CLOS | ||
END | ||
Wait until keyword succeeds 3min 10sec All container is closed | ||
Wait until keyword succeeds 4min 10sec All container is closed | ||
|
||
All container is closed | ||
${output} = Execute ozone admin container list --state OPEN | ||
|
@@ -146,15 +147,15 @@ Get Datanode Ozone Used Bytes Info | |
[return] ${result} | ||
|
||
** Test Cases *** | ||
Verify Container Balancer for RATIS containers | ||
Verify Container Balancer for RATIS/EC containers | ||
Prepare For Tests | ||
|
||
Datanode In Maintenance Mode | ||
|
||
${uuid} = Get Uuid | ||
Datanode Usageinfo ${uuid} | ||
|
||
Create Multiple Keys 3 | ||
Create Multiple Keys ${KEYS} | ||
|
||
Close All Containers | ||
|
||
|
@@ -175,8 +176,10 @@ Verify Container Balancer for RATIS containers | |
|
||
${datanodeOzoneUsedBytesInfoAfterContainerBalancing} = Get Datanode Ozone Used Bytes Info ${uuid} | ||
Should Not Be Equal As Integers ${datanodeOzoneUsedBytesInfo} ${datanodeOzoneUsedBytesInfoAfterContainerBalancing} | ||
Should Be True ${datanodeOzoneUsedBytesInfoAfterContainerBalancing} < ${SIZE} * 3.5 | ||
Should Be True ${datanodeOzoneUsedBytesInfoAfterContainerBalancing} > ${SIZE} * 3 | ||
#We need to ensure that after balancing, the amount of data recorded on each datanode falls within the following ranges: | ||
#{SIZE}*3 < used < {SIZE}*3.5 for RATIS containers, and {SIZE}*1.5 < used < {SIZE}*2.5 for EC containers. | ||
Should Be True ${datanodeOzoneUsedBytesInfoAfterContainerBalancing} < ${SIZE} * ${UPPER_LIMIT} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be great to have a description of what UPPER_LIMIT and LOWER_LIMIT are. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
Should Be True ${datanodeOzoneUsedBytesInfoAfterContainerBalancing} > ${SIZE} * ${LOWER_LIMIT} | ||
|
||
|
||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the reason behind doubling the timeout here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It’s not exactly a timeout. We expect the balancing to complete within 6 minutes, but if it finishes earlier, we will proceed with the test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, but earlier the tests seem to have been working fine within 3mins. Did you observe some cases where it took more than 3 mins to complete the balancing during testing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, in case of the EC container, it takes more than 5 minutes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, Changes LGTM.