Bug 735981

Summary: Update breaks behaviour of --one-file-system --relative --delete
Product: Red Hat Enterprise Linux 6 Reporter: Simon Matter <simon.matter>
Component: rsyncAssignee: Michal Ruprich <mruprich>
Status: CLOSED WONTFIX QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.6CC: mluscon, thozza, vgaikwad
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-09-06 08:54:34 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Simon Matter 2011-09-06 11:12:31 UTC
Description of problem:
The recent rsync update on RHEL5.7 breaks the options --relative --delete. If it's inteneded behaviour it is at least a regression I guess.

Version-Release number of selected component (if applicable):
rsync-3.0.6-4.el5_7.1

How reproducible:
always

Steps to Reproduce:
1. on remotehost: mount /var and /var/opt on separate filesystems
2. on remotehost: cp -a /etc /var/opt/XXX
3. on target host: rsync -aHv --delete --numeric-ids --relative --delete-excluded remotehost:/var /home/snapshots/TEST
4. on target host, repeat but with -x: rsync -aHvx --delete --numeric-ids --relative --delete-excluded remotehost:/var /home/snapshots/TEST
  
Actual results:
/home/snapshots/TEST/var/opt/XXX/ is still there with its content

Expected results:
/home/snapshots/TEST/var/opt/XXX/ should have been removed

Additional info:
This has worked with rsync from EL5.6. With -xx it works but it also removes the mount point itself (which is expected with -xx) but -x should include the the mount point as empty directory, and therefore clean up on the target side.
I have tested with latest rsync from upstream (3.0.8) and it also has the bug/feature. Older versions (at least the 2.x series) work okay and do what the manual says. I consider this a regression at least for EL5.7.

Comment 2 mahaveer darade 2012-05-24 12:53:06 UTC
I tried to check if RHEL-5.5 & RHEL-5.6 works as expected but found that nothing gets deleted under mount point. 

Client: 
-------
[root@dhcp209-81 /]# mount | grep -i 210.105
10.65.210.105:/root/dir1 on /mnt type nfs (rw,addr=10.65.210.105)
10.65.210.105:/root/dir2 on /mnt/alsa type nfs (rw,addr=10.65.210.105)
[root@dhcp209-81 /]# ls /mnt/alsa/
bashrc  beah_beaker.conf  beah.conf  blkid  bluetooth  bonobo-activation
[root@dhcp209-81 /]# 
[root@dhcp209-81 /]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 5.5 (Tikanga)
[root@dhcp209-81 /]# 


Server:
-------
[root@dhcp209-98 /]# ls /tmp/
[root@dhcp209-98 /]# rsync -aH --delete --numeric-ids --relative --delete-excluded 10.65.209.81:/mnt /tmp/
root.209.81's password: 
[root@dhcp209-98 /]# ls /tmp/mnt/alsa/
bashrc  beah_beaker.conf  beah.conf  blkid  bluetooth  bonobo-activation
[root@dhcp209-98 /]# rsync -axH --delete --numeric-ids --relative --delete-excluded 10.65.209.81:/mnt /tmp/
root.209.81's password: 
[root@dhcp209-98 /]# ls /tmp/mnt/alsa/
bashrc  beah_beaker.conf  beah.conf  blkid  bluetooth  bonobo-activation
[root@dhcp209-98 /]# 
[root@dhcp209-98 /]# 
[root@dhcp209-98 /]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 5.6 (Tikanga)
[root@dhcp209-98 /]# rpm -qa | grep -i rsync
rsync-2.6.8-3.1
[root@dhcp209-98 /]# 

As per man page: 
 -x, --one-file-system
              This  tells  rsync to avoid crossing a filesystem boundary when recursing.  This does not limit the user’s ability to specify items to
              copy from multiple filesystems, just rsync’s recursion through the hierarchy of each directory that the user specified, and  ***also  the
              analogous  recursion  on the receiving side during deletion***.

So I guess rsync won't delete files under mount point on receiving end. CMIIW.

Comment 3 Michal Luscon 2012-05-28 15:25:36 UTC
I am confirming the modification of rsync behaviour between 2.x and 3.x version.

Comment 4 RHEL Program Management 2012-06-12 01:14:52 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.

Comment 5 Pavel Šimerda (pavlix) 2014-02-12 15:51:20 UTC
This Bugzilla has been reviewed by Red Hat and is not planned on being addressed in Red Hat Enterprise Linux 5, and therefore will be moved to Red Hat Enterprise Linux 6. If this bug is critical to production systems, please contact your Red Hat support representative and provide sufficient business justification.

Comment 9 Tomáš Hozza 2017-09-06 08:54:34 UTC
Red Hat Enterprise Linux 6 transitioned to the Production 3 Phase on May 10, 2017.  During the Production 3 Phase, Critical impact Security Advisories (RHSAs) and selected Urgent Priority Bug Fix Advisories (RHBAs) may be released as they become available.

The official life cycle policy can be reviewed here:
http://redhat.com/rhel/lifecycle

This issue does not appear to meet the inclusion criteria for the Production Phase 3 and will be marked as CLOSED/WONTFIX. If this remains a critical requirement, please contact Red Hat Customer Support to request a re-evaluation of the issue, citing a clear business justification.  Red Hat Customer Support can be contacted via the Red Hat Customer Portal at the following URL:

https://access.redhat.com