Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
3.1.1
-
None
Description
When setting an erasure coding policy for which there are not enough racks or data nodes, write will fail with the following message:
[root@oks-upgrade6727-1 ~]# sudo -u systest hdfs dfs -mkdir /user/systest/testdir
[root@oks-upgrade6727-1 ~]# sudo -u hdfs hdfs ec -setPolicy -path /user/systest/testdir
Set default erasure coding policy on /user/systest/testdir
[root@oks-upgrade6727-1 ~]# sudo -u systest hdfs dfs -put /tmp/file1 /user/systest/testdir
18/11/12 05:41:26 WARN hdfs.DFSOutputStream: Cannot allocate parity block(index=3, policy=RS-3-2-1024k). Not enough datanodes? Exclude nodes=[]
18/11/12 05:41:26 WARN hdfs.DFSOutputStream: Cannot allocate parity block(index=4, policy=RS-3-2-1024k). Not enough datanodes? Exclude nodes=[]
18/11/12 05:41:26 WARN hdfs.DFSOutputStream: Block group <1> failed to write 2 blocks. It's at high risk of losing data.
I suggest to log a more descriptive message suggesting to use hdfs ec -verifyCluster command to verify the cluster setup against the ec policies.