mirror of
https://github.com/zrepl/zrepl.git
synced 2024-11-22 00:13:52 +01:00
Allow same root_fs for different jobs: sinks and so on (#752)
Because some jobs add client identity to root_fs and other jobs don't do that, we can't reliable detect overlapping of filesystems. And and the same time we need an ability to use equal or overlapped root_fs for different jobs. For instance see this config: ``` - name: "zdisk" type: "sink" root_fs: "zdisk/zrepl" serve: type: "local" listener_name: "zdisk" ``` and ``` - name: "remote-to-zdisk" type: "pull" connect: type: "tls" root_fs: "zdisk/zrepl/remote" ``` As you can see, two jobs have overlapped root_fs, but actually datasets are not overlapped, because job `zdisk` save everything under `zdisk/zrepl/localhost`, because it adds client identity. So they actually use two different filesystems: `zdisk/zrepl/localhost` and `zdisk/zrepl/remote`. And we can't detect this situation during config check. So let's just remove this check, because it's admin's duty to configure correct root_fs's. --------- Co-authored-by: Christian Schwarz <me@cschwarz.com>
This commit is contained in:
parent
30faaec26a
commit
27012e5623
@ -24,21 +24,6 @@ func JobsFromConfig(c *config.Config, parseFlags config.ParseFlags) ([]Job, erro
|
|||||||
js[i] = j
|
js[i] = j
|
||||||
}
|
}
|
||||||
|
|
||||||
// receiving-side root filesystems must not overlap
|
|
||||||
{
|
|
||||||
rfss := make([]string, 0, len(js))
|
|
||||||
for _, j := range js {
|
|
||||||
jrfs, ok := j.OwnedDatasetSubtreeRoot()
|
|
||||||
if !ok {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
rfss = append(rfss, jrfs.ToString())
|
|
||||||
}
|
|
||||||
if err := validateReceivingSidesDoNotOverlap(rfss); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return js, nil
|
return js, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -258,6 +258,9 @@ On your setup, ensure that
|
|||||||
|
|
||||||
* all ``filesystems`` filter specifications are disjoint
|
* all ``filesystems`` filter specifications are disjoint
|
||||||
* no ``root_fs`` is a prefix or equal to another ``root_fs``
|
* no ``root_fs`` is a prefix or equal to another ``root_fs``
|
||||||
|
|
||||||
|
* For ``sink`` jobs, consider all possible ``root_fs/${client_identity}``.
|
||||||
|
|
||||||
* no ``filesystems`` filter matches any ``root_fs``
|
* no ``filesystems`` filter matches any ``root_fs``
|
||||||
|
|
||||||
**Exceptions to the rule**:
|
**Exceptions to the rule**:
|
||||||
|
Loading…
Reference in New Issue
Block a user