Skip to content
Snippets Groups Projects
Commit 057730ee authored by Geoffray Adde's avatar Geoffray Adde
Browse files

MGM: revert an accidental overwrite in merge

parent 946a35ed
No related branches found
Tags 4.0.19
No related merge requests found
......@@ -210,114 +210,8 @@ Scheduler::FilePlacement(const std::string& spacename,
}
else
{
<<<<<<< HEAD
eos_static_debug("could not place all replica(s) for %s in subgroup %s, "
"checking next group", path, group->mName.c_str());
=======
std::list<eos::common::FileSystem::fsid_t>::iterator ait;
ait = availablevector.begin();
for (unsigned int loop = 0; loop < 1000; loop++)
{
// we cycle over the available filesystems
float randomacceptor = (0.999999 * random() / RAND_MAX);
eos_static_debug("fs %u acceptor %f/%f for %d. replica [loop=%d] [avail=%d]", *ait, randomacceptor, availablefs[*ait], nassigned + 1, loop, availablevector.size());
if (nassigned == 0)
{
// push it on the selection list
if (hasgeolocation)
{
selected_geo_location = availablefsgeolocation[*ait];
if ((!geo_entry_fsid) && (vid.geolocation == availablefsgeolocation[*ait]))
{
// if this is the first matching
geo_entry_fsid = *ait;
}
}
eos_static_debug("fs %u selected for %d. replica", *ait, nassigned + 1);
if ( (nfilesystems==1) && exact_match && !geo_entry_fsid)
{
ait = availablevector.erase(ait);
if (ait == availablevector.end())
ait = availablevector.begin();
}
else
{
selected_filesystems.push_back(*ait);
// remove it from the selection map
availablefs.erase(*ait);
ait = availablevector.erase(ait);
if (ait == availablevector.end())
ait = availablevector.begin();
// rotate scheduling view ptr
nassigned++;
}
}
else
{
// we select a random one
unsigned int randomindex;
randomindex = (unsigned int) ((0.999999 * random() * availablefs.size()) / RAND_MAX);
eos_static_debug("trying random index %d", randomindex);
for (unsigned int i = 0; i < randomindex; i++)
{
ait++;
if (ait == availablevector.end())
ait = availablevector.begin();
}
float fsweight = availablefs[*ait];
// only when we need one more geo location, we lower the selection probability
if ((hasgeolocation) && (n_geolocations != 1) && (selected_geo_location == availablefsgeolocation[*ait]))
{
if (exact_match)
// we dont' schedule not according to geolocation policy
fsweight = 0.0;
else
// we reduce the probability to select a filesystem in an already existing location to 1/20th
fsweight *= 0.05;
}
if (fsweight > randomacceptor)
{
if (hasgeolocation && (!geo_entry_fsid) && (vid.geolocation == availablefsgeolocation[*ait]))
{
// if this is the first matching
geo_entry_fsid = *ait;
}
// push it on the selection list
selected_filesystems.push_back(*ait);
if (hasgeolocation)
{
if (selected_geo_location != availablefsgeolocation[*ait])
{
n_geolocations++;
}
}
eos_static_debug("fs %u selected for %d. replica", *ait, nassigned + 1);
// remove it from the selection map
availablefs.erase(*ait);
ait = availablevector.erase(ait);
nassigned++;
if (ait == availablevector.end())
ait = availablevector.begin();
}
}
if (nassigned >= nfilesystems)
break;
if (ait == availablevector.end())
break;
} // leave the <loop> where filesystems get selected by weight
>>>>>>> origin/beryl_aquamarine
}
if (groupindex >= groupsToTry.size())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment