When creating a namespace, we try to set the group of the data directory to be the same as the group of the namespace's root, unless a groupName is explicitly configured, then we use that. This fails if the namespace owner/principal is not a member of that group.
- We need to document that the principal must be a member of the group
- If the groupName is not configured, it is possible that the root has a group that the principal is not a member of. In that case, namespace creation should not fail. This can happen because HDFS is a BSD-style file system, where a directory by default inherits the group id of its parent (and the owner/creator is not necessarily a member of the parent's group). So we should either
- only set the group if the principal is a member, or
- only set the group if is was explicitly configured via the groupName property. I think that is the best approach, because it inherits the root directory's group by default, so there should never be a need to change it explicitly.