Help debugging a problem when trying to use lsyncd and rsync filter rules to stop specific xattrs being removed at the destination

342 views
Skip to first unread message

Gary Richards

unread,
Jul 3, 2020, 4:45:29 PM7/3/20
to lsyncd
Hi,

I'm trying to use lsyncd to sync a filesystem that has xattrs that I need to retain to some cephfs.

My first attempt almost works, but I get errors like the following?

rsync: rsync_xal_set: lremovexattr("/mnt/backup/some.d","ceph.dir.rctime") failed: Operation not supported (95). This makes alot of sense, i'm pretty sure Ceph doesn't want me removing its own metadata so is explicitly not allowing it.

So I looked more at the rsync ocs and as far as I can tell, I should be able to use rsync filter rules to exclude specific xattrs from being deleted at the remote side, the docs even give an example:

To prevent any attributes from being deleted, you could specify a receiver-only rule that excludes all names:
                  --filter='-xr *'
 
I tweaked that slightly in an attempt to stop it trying to remove the ceph entries. My resultant config looks like this:

    settings {
        nodaemon
= true
   
}
    sync
{
       
default.rsync,
        source    
= "/mnt/local",
        target    
= "/mnt/backup",
        rsync    
= {
          acls      
= true,
          archive    
= true,
          hard_links
= true,
          xattrs    
= true,
          verbose    
= true,
       
},
        filter    
= {
         
'-xr ceph.*',
       
},
   
}


However, I still see the same errors.

From the lsyncd logs I also see
20:37:34 Normal: recursive startup rsync: /mnt/local/ -> /mnt/backup/ filtering
- xr ceph.*

Suggesting it at least knows about my filter.

But either it doesn't seem to be working or I'm misunderstanding how it's supposed to be used.

Assuming the former, I have tried to work out what rsync command lsyncd is running so that I could run it manually and try to debug the problem more, but i've so far failed to work out how to get that information. I can't see any option that exists that allows me to enable more verbose logging, or debug logging or anything.

Thanks

Gary Richards

unread,
Jul 3, 2020, 4:53:17 PM7/3/20
to lsyncd
It just occurred to me that from the config I could have a go at reproducing the command that I would expect lsyncd to be running and I came up with:

rsync -av --delete --acls --hard-links --xattrs  --filter='-xr ceph.*' /mnt/local /mnt/backup

Which appears to work as I expect. I don't get any 'Operation not supported' messages

Suggesting that lsyncd isn't handing my filter correctly or i'm putting together the wrong rsync command!

So i'm back to trying to work out exactly what command lsyncd is running.

Gary Richards

unread,
Jul 3, 2020, 5:19:46 PM7/3/20
to lsyncd
I realised that -log all was still available on the command line, which i'd missed as pretty much all of the other command line options seem to be able to go into the settings section of the config now!

Anyhow, the logs came up with this:
21:12:25 Exec: /usr/bin/rsync [<] [- xr ceph.*] [--filter=. -] [--delete] [--ignore-errors] [-slXAopgtvHD] [-r] [/mnt/local/] [/mnt/backup/]

I'm not entirely sure what the < is doing, but I would have expected the '- xr ceph.*' to be proceeded by its own --filter=  to be valid?

gary.r...@gmail.com

unread,
Sep 8, 2020, 8:33:20 AM9/8/20
to lsyncd
On the off chance anyone else comes across this and is struggling to make it work...

I managed to make this work using _extra, I had misunderstood how lsyncd passes arguments to the rsync command. More info here: https://github.com/axkibe/lsyncd/issues/603

But basically you don't need to quote the filter like you would on the command line, so this works fine:
_extra     = {
  "--filter=-xr ceph.*",
}
Reply all
Reply to author
Forward
0 new messages