Details
Description
When trying to rename a non-existent HDFS snapshot to ITSELF, there are no errors and exits with a success code.
The steps to reproduce this issue is:
hdfs dfs -mkdir /tmp/dir1
hdfs dfsadmin -allowSnapshot /tmp/dir1
hdfs dfs -createSnapshot /tmp/dir1 snap1_dir
Rename from non-existent to another_non-existent : errors and return code 1. This is correct.
hdfs dfs -renameSnapshot /tmp/dir1 nonexist another_nonexist :
echo $?
renameSnapshot: The snapshot nonexist does not exist for directory /tmp/dir1
Rename from non-existent to non-existent : no errors and return code 0 instead of Error and return code 1.
hdfs dfs -renameSnapshot /tmp/dir1 nonexist nonexist ; echo $?
Current behavior: No error and return code 0.
Expected behavior: An error returned and return code 1.