Details
-
New Feature
-
Resolution: Unresolved
-
Minor
-
None
-
None
-
9223372036854775807
Description
Multiple filesets per nodemap would be beneficial. The filesets consist of one primary path and several alternate path for a given tenant's nodemap. The primary fileset (mostly) corresponds to the current implementation's single available fileset. The proposed API, mounting rules, persistence mechanism, and update/downgrade behavior are described below:
API
(new) lctl nodemap_fileset_add --name <nodemap_name> [--alt] [--ro] --fileset <path>
- Works on both types of filesets based on a flag --alt to add an alternate fileset.
- Any fileset can be set read-only with --ro.
- Any type of fileset can only be added once and does not overwrite - returns EEXIST if already set. If the passed path is equal to a currently stored fileset (based on whether primary/alternate filesets are addressed), no error code is set and the request is quietly ignored.
- Only one primary fileset is allowed. Note, a primary fileset is not required to set alternate filesets and vice versa.
- Alternate filesets are continuously added when the --alt flag is set.
2. (new) lctl nodemap_fileset_del --name <nodemap_name> --fileset <single_fileset_path>
- Works on both types of filesets by their path and deletes a fileset.
3. (new) lctl nodemap_fileset_modify --name <nodemap_name> --fileset <fileset_path> [--rename <new_fileset_path>] [--ro] [--rw]
- Works on both types of filesets by their path.
- Used to change a fileset path (similar to rename) or flag in-place using the --rename (or similar) option.
- Duplicate filesets are not allowed across all fileset types.
- Flags, i.e., --ro, --rw, can be set.
4. (new) lctl nodemap_filesets_clear --name <nodemap_name>
- Works on all filesets and deletes all primary and alternate filesets for a nodemap.
5. (deprecate, leave as is) nodemap_set_fileset --name <nodemap_name> --fileset <single_fileset_path>
- This command does not seem to be useful for the future both semantically and functionally. The main concern is that we would need some format to address multiple filesets, their types, and flags all in one string if the command should be flexible. It is also a duplicate of nodemap_add_fileset. Therefore, replacing it with nodemap_fileset_add seems preferable.
- With multiple filesets, this command would only overwrite the primary fileset without affecting alternate filesets, which this command cannot address.
6. (extended) lctl get_param nodemap.<nodemap_name>.fileset
- Prints all filesets and their type in a similar format as other nodemap properties that can be fetched with lctl get_param.
7. (extended) lctl nodemap_info [--name <nodemap_name>] [--list-properties] [-–property <value>]
- Extends the existing lctl nodemap_info command to support all nodemap properties and values including filesets. Overall, this makes the command more useful in practice as it can currently only list the property names and not their values.
- Note, the current command uses positional parameters [<nm>|all|list]. This should remain backward compatible for some time but deprecated.
9. (deprecate, leave as is) lctl set_param nodemap.<nm>.fileset=<path>
- This command should be deprecated since we should use the nodemap IAM for persistence.
- Similar to lctl nodemap_set_fileset it would only affect the primary fileset when used.
Mounting rules
- If the nodemap is inactive or no filesets are set, there are no fileset restrictions on the mounting subdir.
- If no mounting subdir is set, the primary fileset is used and the mounting subdir is replaced by it.
- If any fileset (primary and alternate) fileset matches the mounting subdir exactly or as a prefix, the client is permitted to mount the subdir.
- If no fileset was found in 3., the mounting subdir is appended to the primary fileset.
- In all cases (for rules 2-4), the subdir must exist to mount it.
If no primary fileset is set, rules 2 and 4 are omitted, forcing an mount subdir that is represented by a alternate fileset.
Persistence mechanism and update/downgrade behavior
Similar to other nodemap properties, filesets should use the nodemap IAM records for persistence. The current mechanism to use the params llog with lctl set_param -P nodemap.<nm_name>.fileset=<fileset> is deprecated and would only affect the primary fileset. Note, it must remain in operation to allow backward-compatibility. Therefore, a previously set fileset is converted into a primary fileset on an update.
Due to the use of the nodemap IAM for persistence, multiple filesets are not downgrade-compatible. The fileset would fall-back to any available fileset definition in the params llog.