zrepl icon indicating copy to clipboard operation
zrepl copied to clipboard

More than one job per node possible?

Open richlim opened this issue 8 years ago • 4 comments

Hi, thank you for I tried to work with two jobs on the client and server side:

  • work job with 10m snapshot interval
  • archive job with 1h snapshot interval The client side works fine. The snapshots are created and pruned correctly. The server config has also two jobs for the node accordingly. Pulling snapshot from server side for the node works only for first job specified in the client config. Is this a bug or a feature?

richlim avatar Sep 24 '18 16:09 richlim

I'm not sure if I understand your goal correctly. Why do you need 2 jobs per side?

In general, the design in zrepl 0.0.3 is such that a filesystem should only ever be snapshotted by one source job. It could work with 2 source jobs on the same filesystem if you specify different prefixes for the snapshot names. But it will also result in 2x the number of snapshots, and the data will be replicated 2x (once per job).

problame avatar Sep 25 '18 12:09 problame

Ok. I'd like to snaphot at different pace. Here is the client config: global: logging: - outlet: stdout level: debug format: human

jobs:

  • name: pull_work type: source serve: type: stdinserver client_identity: kvm.lima.loc filesystems: { "tank/work/ds1": "ok", } snapshot_prefix: zrepl_ interval: 5m prune: policy: grid grid: 1x1d(keep=all) keep_bookmarks: 144

  • name: pull_arch type: source serve: type: stdinserver client_identity: kvm.lima.loc filesystems: { "tank/arch/ds1": "ok", } snapshot_prefix: zrepl_ interval: 10m prune: policy: grid grid: 1x1d(keep=all) keep_bookmarks: 144

This works. After 20 minutes I have: root@ubuntu:~# zfs list -r -t snapshot tank/work tank/arch NAME USED AVAIL REFER MOUNTPOINT tank/arch/ds1@zrepl_20180925_141528_000 0B - 96K - tank/arch/ds1@zrepl_20180925_142529_000 0B - 96K - tank/work/ds1@zrepl_20180925_141528_000 0B - 96K - tank/work/ds1@zrepl_20180925_142029_000 0B - 96K - tank/work/ds1@zrepl_20180925_142529_000 0B - 96K -

Now the server. I'd like to pull at the same pace as snapshoting on the client. Here is the config: global: logging: - outlet: stdout level: debug format: human

jobs:

  • name: pull_work type: pull connect: type: ssh+stdinserver host: ubuntu.lima.loc user: root port: 22 identity_file: /etc/zrepl/ssh/identity interval: 5m mapping: { "tank/work/ds1":"tank/zrepl/ubuntu/work/ds1" } initial_repl_policy: most_recent snapshot_prefix: zrepl_ prune: policy: grid grid: 1x1h(keep=all) | 24x1h | 35x1d | 6x30d

  • name: pull_arch type: pull connect: type: ssh+stdinserver host: ubuntu.lima.loc user: root port: 22 identity_file: /etc/zrepl/ssh/identity interval: 10m mapping: { "tank/arch/ds1":"tank/zrepl/ubuntu/arch/ds1" } initial_repl_policy: most_recent snapshot_prefix: zrepl_ prune: policy: grid grid: 1x1h(keep=all) | 24x1h | 35x1d | 6x30d

Executing "zrepl daemon" on the server yields: root@kvm:/etc/zrepl# zrepl daemon 2018-09-25T16:25:42+02:00 [INFO]: zrepl version=0.0.3 GOOS=linux GOARCH=amd64 Compiler=gc 2018-09-25T16:25:42+02:00 [DEBG]: starting daemon 2018-09-25T16:25:42+02:00 [INFO]: starting jobs from config 2018-09-25T16:25:42+02:00 [INFO][pull_work]: starting 2018-09-25T16:25:42+02:00 [INFO][pull_arch]: starting 2018-09-25T16:25:42+02:00 [INFO][control]: starting 2018-09-25T16:25:42+02:00 [INFO][pull_work][main.run]: connecting 2018-09-25T16:25:42+02:00 [INFO][pull_arch][main.run]: connecting 2018-09-25T16:25:42+02:00 [INFO][pull_work][main.run.pull.run]: request remote filesystem list 2018-09-25T16:25:42+02:00 [DEBG][pull_work][main.run.pull.run]: map remote filesystems to local paths and determine order for per-filesystem sync 2018-09-25T16:25:42+02:00 [DEBG][pull_work][main.run.pull.run]: build cache for already present local filesystem state 2018-09-25T16:25:43+02:00 [INFO][pull_work][main.run.pull.run]: start per-filesystem sync 2018-09-25T16:25:43+02:00 [INFO][pull_work][main.run.pull]: closing rpc connection 2018-09-25T16:25:43+02:00 [INFO][pull_arch][main.run.pull.run]: request remote filesystem list 2018-09-25T16:25:43+02:00 [DEBG][pull_arch][main.run.pull.run]: map remote filesystems to local paths and determine order for per-filesystem sync 2018-09-25T16:25:43+02:00 [DEBG][pull_arch][main.run.pull.run.build_repl_mapping][tank/arch/ds1 => tank/zrepl/ubuntu/arch/ds1]: mapping 2018-09-25T16:25:43+02:00 [DEBG][pull_arch][main.run.pull.run]: build cache for already present local filesystem state 2018-09-25T16:25:44+02:00 [INFO][pull_work][main.run.prune.run.filter_fs]: no filesystems matching filter 2018-09-25T16:25:44+02:00 [INFO][pull_arch][main.run.pull.run]: start per-filesystem sync 2018-09-25T16:25:44+02:00 [DEBG][pull_arch][main.run.pull.run.tree_walk.repl_fs][tank/arch/ds1 => tank/zrepl/ubuntu/arch/ds1]: examining local filesystem state 2018-09-25T16:25:44+02:00 [INFO][pull_arch][main.run.pull.run.tree_walk.repl_fs][tank/arch/ds1 => tank/zrepl/ubuntu/arch/ds1]: local filesystem does not exist 2018-09-25T16:25:44+02:00 [INFO][pull_arch][main.run.pull.run.tree_walk.repl_fs][tank/arch/ds1 => tank/zrepl/ubuntu/arch/ds1]: requesting remote filesystem versions 2018-09-25T16:25:44+02:00 [DEBG][pull_arch][main.run.pull.run.tree_walk.repl_fs][tank/arch/ds1 => tank/zrepl/ubuntu/arch/ds1]: computing diff between remote and local filesystem versions 2018-09-25T16:25:44+02:00 [DEBG][pull_arch][main.run.pull.run.tree_walk.repl_fs][tank/arch/ds1 => tank/zrepl/ubuntu/arch/ds1]: diff between local and remote filesystem diff="ConflictAllRight, 3 versions, most recent is #zrepl_20180925_142529_000" 2018-09-25T16:25:44+02:00 [INFO][pull_arch][main.run.pull.run.tree_walk.repl_fs][tank/arch/ds1 => tank/zrepl/ubuntu/arch/ds1]: performing initial sync, following policy replication_policy=most_recent 2018-09-25T16:25:44+02:00 [DEBG][pull_arch][main.run.pull.run.tree_walk.repl_fs][tank/arch/ds1 => tank/zrepl/ubuntu/arch/ds1]: requesting snapshot stream version=@zrepl_20180925_142529_000 2018-09-25T16:25:44+02:00 [DEBG][pull_arch][main.run.pull.run.tree_walk.repl_fs][tank/arch/ds1 => tank/zrepl/ubuntu/arch/ds1]: received initial transfer request response 2018-09-25T16:25:44+02:00 [DEBG][pull_arch][main.run.pull.run.tree_walk.repl_fs][tank/arch/ds1 => tank/zrepl/ubuntu/arch/ds1]: invoke zfs receive 2018-09-25T16:25:45+02:00 [INFO][pull_arch][main.run.pull.run.tree_walk.repl_fs][tank/arch/ds1 => tank/zrepl/ubuntu/arch/ds1]: finished receiving stream 2018-09-25T16:25:45+02:00 [DEBG][pull_arch][main.run.pull.run.tree_walk.repl_fs][tank/arch/ds1 => tank/zrepl/ubuntu/arch/ds1]: configuring properties of received filesystem 2018-09-25T16:25:45+02:00 [INFO][pull_arch][main.run.pull.run.tree_walk.repl_fs][tank/arch/ds1 => tank/zrepl/ubuntu/arch/ds1]: finished initial transfer 2018-09-25T16:25:45+02:00 [INFO][pull_arch][main.run.pull]: closing rpc connection 2018-09-25T16:25:46+02:00 [DEBG][pull_arch][main.run.prune.run.prune_fs][tank/zrepl/ubuntu/arch/ds1]: prune policy debug dump keep=<[]zfs.FilesystemVersion> fsversions=<[]zfs.FilesystemVersion> remove=<[]zfs.FilesystemVersion>

The result is: only one job did run: root@kvm:/etc/zrepl# zfs list -r -t snapshot tank/zrepl/ubuntu/arch tank/zrepl/ubuntu/work NAME USED AVAIL REFER MOUNTPOINT tank/zrepl/ubuntu/arch/ds1@zrepl_20180925_142529_000 0B - 96K -

The question once again: is it possible to run more than one pull job on the server for a client node?

richlim avatar Sep 25 '18 14:09 richlim

You need to specify different client identities to do that. If you specify the same client identity for two source jobs, the unix socket names in /var/run/zrepl/stdinserver/$CLIENT_IDENTITY conflict on the source-side.

problame avatar Sep 25 '18 19:09 problame

Ok. It works. Thank you for your support!

richlim avatar Sep 26 '18 15:09 richlim