mirror of
https://github.com/ceph/ceph
synced 2025-03-11 02:39:05 +00:00
crimson/osd: fix misdirecting msgs when an OSD flips at Sepia.
For description please refer to: * https://gist.github.com/rzarzynski/6cbc20fb28d7ac096ecc4b68500454bf#gistcomment-3830762, * https://gist.github.com/rzarzynski/6cbc20fb28d7ac096ecc4b68500454bf#gistcomment-3830939. Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
This commit is contained in:
parent
a5fd875665
commit
d0a5dd7e36
@ -114,13 +114,13 @@ seastar::future<> make_keyring()
|
||||
|
||||
uint64_t get_nonce()
|
||||
{
|
||||
if (auto pid = getpid(); pid != 1) {
|
||||
return pid;
|
||||
} else {
|
||||
if (auto pid = getpid(); pid == 1 || std::getenv("CEPH_USE_RANDOM_NONCE")) {
|
||||
// we're running in a container; use a random number instead!
|
||||
std::random_device rd;
|
||||
std::default_random_engine rng{rd()};
|
||||
return std::uniform_int_distribution<uint64_t>{}(rng);
|
||||
} else {
|
||||
return pid;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user