Only Use primary for write.lock and make mapping consistent for files in DistDirecotyr