glyustb / mogilefs

Automatically exported from code.google.com/p/mogilefs
0 stars 0 forks source link

create_open and ZoneLocal return bad devices #56

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hello, 
i found some probelm with ZoneLocal plugin and 2.55 version. I have 
configured two zones (center1,center2). Get_paths work OK and gives 
paths from proper zone but create_open command gives paths to storage 
in second zone.

> This is existing production setup with above hundred devices (maybe 
> problem is connected with that?). It looks like always will be chosed 
> device with lower disk space utilization. 

You may be right on that; at some point I changed the filtering. 
I see in ZoneLocal: 
        @$sorted_devs = prioritize_devs_current_zone( 
                        $MogileFS::REQ_client_ip, 
MogileFS::Worker::Query::sort_devs_by_freespace(@$devices) 
                        ); 
sort_devs_by_freespace was running very slowly with large lists, because 
of weighted_list, so it only looks at the first 20. 
Which is then *later* sorted by current zone. 
You can test a fix by finding: 
    my @list = 
        MogileFS::Util::weighted_list(splice(@devices_with_weights, 0, 
20)); 
in Worker/Query.pm, and changing that "20" to 100 or 200, then restarting 
the tracker. 

--> NOTE - that patch is working, increased to number higher than total number 
of devices (to 200) gives proper paths from this same data center --<

So that's probably it. Need to think a bit on how to fix it though; we 
probably want to do the filtering a little more intelligently... First 
filter by writeable devices (not full/dead/etc), then split by zone, and 
only use @other_zone if there're no local devs. Then apply the rest of the 
filtering afterwards. 

Original issue reported on code.google.com by planck...@gmail.com on 8 Feb 2012 at 7:44

GoogleCodeExporter commented 8 years ago
need to stop adding more bugs than I fix :P

we'll get this for the next cut, thanks for testing!

Original comment by dorma...@rydia.net on 8 Feb 2012 at 7:49

GoogleCodeExporter commented 8 years ago
MogileFS::Network 0.06 has this fixed now. The filtering is reordered so it'll 
consider the 20 "Freeest" devices from the correct zone before all other zones.

Original comment by dorma...@rydia.net on 29 Feb 2012 at 7:44

GoogleCodeExporter commented 8 years ago
er, closing

Original comment by dorma...@rydia.net on 29 Feb 2012 at 7:44

GoogleCodeExporter commented 8 years ago
work's fine :)

Original comment by planck...@gmail.com on 6 Mar 2012 at 1:02