Bug 1475133

Summary: Files are not rebalanced if destination brick(available size) is of smaller size than source brick(available size)
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: Nag Pavan Chilakam <nchilaka>
Component: distributeAssignee: Nithya Balachandran <nbalacha>
Status: CLOSED ERRATA QA Contact: Sayalee <saraut>
Severity: medium Docs Contact:
Priority: medium    
Version: rhgs-3.3CC: amukherj, rhinduja, rhs-bugs, storage-qa-internal
Target Milestone: ---Keywords: Rebase
Target Release: RHGS 3.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: glusterfs-6.0-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1529440 (view as bug list) Environment:
Last Closed: 2019-10-30 12:19:37 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1290124, 1529440, 1530455, 1696807    

Description Nag Pavan Chilakam 2017-07-26 06:52:42 UTC
Description of problem:
=======================
When we add a brick which is of smaller size, when we trigger rebalance, files are not moved from the src_brick to dst_brick if src_available_space >dst_available_space
Below are the problems due to this situation
1)we must not be checking dst_available_space but , rather see if the file being migrated has sufficient space to fit in the dst_brick or not
2)even though we are not migrating, we scan whole filesystem, everytime a rebalance is triggered. This is waste of cpu cycles. 
Agree, that layout fixing happens, but fixing would have happened as part of first rebalance completion. We don't have to probably try to fix everytime, given that when i am writing new files, they are anyways getting distributed b/w bricks, and it is only old files, which needs to be rebalanced(ie due to add brick), and first rebalance would have ideally done fix layout. yes there can be exceptions, like the layout fixing may not have been compeleted due to abort or stop by user or unexpected events



Version-Release number of selected component (if applicable):
=========
3.8.4-35


How reproducible:
=========
always

Steps to Reproduce:
1.create a distribute(or distrep) volume with all bricks of say 10GB
2.do some IOs
3.now add brick of size lesser than 10gb say 5gb
3.trigger rebalance
4. add new files
5. from backend, add a file of 5gb on old bricks(to make dst_avail_size >src_avail_size)

Actual results:
==========
after step 3, rebalance completes, but no files are migrated
with step4, new files are distributed as per hashing
with step 5, now rebalance will migrate some old files to dst, but it does only till src_avail_size <dst_avail_size

Comment 2 Nag Pavan Chilakam 2017-07-26 06:55:04 UTC
seems to be a day1 issue and anyways we have a work around of using force command if we want to really force the migration, hence not proposing for 3.3.0

Comment 3 Nithya Balachandran 2017-07-26 08:38:54 UTC
Correct. This is a day 1 issue and there is a workaround. Hence moving this to 3.3-beyond

Comment 5 Nithya Balachandran 2018-01-03 05:34:45 UTC
Upstream patch: https://bugzilla.redhat.com/show_bug.cgi?id=1529440

Comment 12 errata-xmlrpc 2019-10-30 12:19:37 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2019:3249