NetWorker: Skip ASM with Wildcards Fails to Skip Second Consecutive Match if One Mount is Nested
Summary: This article describes an unexpected condition affecting skip ASM directives where using wildcards fails the skip to the second consecutive match when one mount is nested in another.
Symptoms
- Skip directive using wildcards in the path fails to skip the second directory matching the pattern, when nested volume mounts appear consecutively as immediate parent and child
- The second matching
directory/mountis an immediate subdirectory of the first matching directory - The first
directory/mountis skipped, but the nested child mount is backed up entirely
Example:
- Skip directive using a wildcard path of
<< */mnt/vo*/ >> - Volume mounted to
/mnt/vol1 - Separate volume mounted as a child of the first mount, as
/mnt/vol1/vol2
Cause
The parsing of ASM directives by NetWorker has a preference for exact matches over wildcard matches. A separate AS mntasm also automatically identifies mount points as such with exact match directives. The first match causes the search to stop processing the list of directives.
Search through the directive list proceeds in this case proceeds as:
- User-configured exact match directives
- NetWorker auto-added exact match directives (such as
mntasm) - User-configured wildcard match directives
In the absence of a user-configured exact match, mntasm matches the path directly first. Since parsing prefers exact matches, the wildcard match is never reached.
This behavior causes /mnt/vol1/ to be included, even though the directive specified the path /mnt/vo*/. If the nested mount is a direct child of the first, then it processes mntasm first, and escape the wildcard skip directive. Moreover; since that nested mount path has escaped the skip wildcard, all its contents are backed up.
In contrast, if the directive path were explicit /mnt/vol1, the entire folder, and its contents including the nested mount, would be skipped as wanted, since it would be processed prior to mntasm as an exact match.
Resolution
It is not advisable to mount volumes as immediate subdirectories of other mount points; this can cause any number of complications, irrespective of the software used.
If this is an unavoidable requirement in your data zone, you can use either of the following workarounds:
- Use exact-match directives to achieve the wanted behavior, for example
/mnt/vol1AND/mnt/vol1/vol2 - Separating the mount directories with an intermediary directory, for example
/mnt/vol1/foo/vol2should allow the wildcard directive to work, since the parentfoomatches the wildcard, andvol2is never reached in the directive processing.