Re: Luminous builds on FreeBSD are erroring

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 18-10-2018 12:37, kefu chai wrote:
On Wed, Oct 17, 2018 at 3:52 AM Willem Jan Withagen <wjw@xxxxxxxxxxx> wrote:

Hi,

For a while my luminous build error out, but only now I have time to
look at them

Luminous contains:

home/jenkins/workspace/ceph-luminous/src/osd/OSD.cc:2058:34: error: non-constant-expression cannot be narrowed from type 'int' to 'std::__1::linear_congruential_engine<unsigned int, 48271, 0, 2147483647>::result_type' (aka 'unsigned int') in initializer list [-Wc++11-narrowing]
    std::default_random_engine rng{whoami};
                                   ^~~~~~
/home/jenkins/workspace/ceph-luminous/src/osd/OSD.cc:2058:34: note: insert an explicit cast to silence this issue
    std::default_random_engine rng{whoami};
                                   ^~~~~~
                                   static_cast<result_type>( )
1 error generated.

And the code:
double OSD::get_tick_interval() const
{
    // vary +/- 5% to avoid scrub scheduling livelocks
    constexpr auto delta = 0.05;
    std::default_random_engine rng{whoami};
    return (OSD_TICK_INTERVAL *
            std::uniform_real_distribution<>{1.0 - delta, 1.0 + delta}(rng));
}

Now Mimic does not have the initializer for the random engine:
double OSD::get_tick_interval() const
{
    // vary +/- 5% to avoid scrub scheduling livelocks
    constexpr auto delta = 0.05;
    return (OSD_TICK_INTERVAL *
            ceph::util::generate_random_number(1.0 - delta, 1.0 + delta));
}

So can we get the Mimic code in Luminous as well??

no, luminous does not have the generate_random_number helps.
https://github.com/ceph/ceph/pull/24659 should address the FTBFS.
sorry for the inconvenience!

No problem,

Your fix works, but I did not dare to just make a PR agains luminous as my git-foo would certainly do it the wrong way.

So thanx for the patch,
--WjW




[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux