From: Radoslaw Zarzynski Date: Tue, 27 Jul 2021 16:24:55 +0000 (+0000) Subject: crimson/osd: fix misdirecting msgs when an OSD flips at Sepia. X-Git-Tag: v17.1.0~1277^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d0a5dd7e363bd3c6bc799a65358e702a3c4a888b;p=ceph.git 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 --- diff --git a/src/crimson/osd/main.cc b/src/crimson/osd/main.cc index 4b47d89b1510..2c6105af8408 100644 --- a/src/crimson/osd/main.cc +++ b/src/crimson/osd/main.cc @@ -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{}(rng); + } else { + return pid; } }