To reproduce, create folders "/dir" and "/dir/child" in Alluxio, then create "/dir/ufsOnly" in the UFS without going through Alluxio. Now try deleting "/dir" recursively.
/dir/child is deleted since it is in sync with the UFS
/dir is not deleted since it is out of sync with the UFS
/dir is deleted
This is due to a bug in the master where whenever it tries to delete a child of an out-of-sync directory, it deletes the out-of-sync directory instead. If the out-of-sync directory has multiple in-sync children, this will also result in a journal issue where two journal entries in a row attempt to delete the same directory. Once this happens, the master can no longer start up.