dombizita commented on a change in pull request #3065: URL: https://github.com/apache/ozone/pull/3065#discussion_r808553213
########## File path: hadoop-ozone/dist/src/main/smoketest/debug/ozone-debug-dead-datanode.robot ########## @@ -0,0 +1,44 @@ +# 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. + +*** Settings *** +Documentation Test read-replicas in case of one datanode is unavailable +Library OperatingSystem +Resource ../lib/os.robot +Resource ozone-debug.robot +Test Timeout 5 minute +*** Variables *** +${VOLUME} cli-debug-volume +${BUCKET} cli-debug-bucket +${TESTFILE} testfile + +*** Test Cases *** +Test ozone debug read-replicas with one datanode DEAD + ${directory} = Execute read-replicas CLI tool + ${count_files} = Count Files In Directory ${directory} + Should Be Equal As Integers ${count_files} 5 + ${dn1_md5sum} = Execute cat ${directory}/${TESTFILE}_block1_ozone_datanode_1.ozone_default ${directory}/${TESTFILE}_block2_ozone_datanode_1.ozone_default | md5sum | awk '{print $1}' + ${dn3_md5sum} = Execute cat ${directory}/${TESTFILE}_block1_ozone_datanode_3.ozone_default ${directory}/${TESTFILE}_block2_ozone_datanode_3.ozone_default | md5sum | awk '{print $1}' + ${testfile_md5sum} = Execute md5sum testfile | awk '{print $1}' + Should Be Equal ${dn1_md5sum} ${testfile_md5sum} + Should Be Equal ${dn3_md5sum} ${testfile_md5sum} + ${manifest} = Get File ${directory}/${TESTFILE}_manifest + ${json} = Evaluate json.loads('''${manifest}''') json + Compare JSON ${json} + ${datanodes_expected} = Create List ozone_datanode_1.ozone_default ozone_datanode_3.ozone_default + ${datanodes_b1} = Create List ${json}[blocks][0][replicas][0][hostname] ${json}[blocks][0][replicas][1][hostname] + Check for datanodes ${datanodes_b1} ${datanodes_expected} + ${datanodes_b2} = Create List ${json}[blocks][1][replicas][0][hostname] ${json}[blocks][1][replicas][1][hostname] + Check for datanodes ${datanodes_b2} ${datanodes_expected} Review comment: I didn't add it, as it is checking if the manifest file contains the UNAVAILABLE error on that datanode, but that is only happening if the datanode is STALE. If the datanode is dead, there won't be an attempt to download from there, so it won't be appearing in the json. That is why the checking for datanodes only checking for two datanodes and the directory will contain only 5 files (one manifest file, 2x2 downloaded blocks). -- 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]
