]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
osd: wake up more shard workers when new osdmap is consumed 51262/head
authorJianwei Zhang <jianwei1216@qq.com>
Thu, 30 Sep 2021 06:47:01 +0000 (14:47 +0800)
committerKonstantin Shalygin <k0ste@k0ste.ru>
Sat, 2 Sep 2023 21:09:17 +0000 (04:09 +0700)
commit8662711a63b6dc714ec0c703fff0f78e317302e6
tree8e4f63aa91314285fcee639d17ca229a3b4a8cd7
parent6f288f53dfb0c5b25aeef4c430ce1e0721045101
osd: wake up more shard workers when new osdmap is consumed

Reproduce:
(1) ceph cluster not running any client IO
(2) only ceph osd in osd.14 operation

Reason:
(1) one shard-queue has three shard-threads
(2) one or some PeeringOp's epoch > osdmap's epoch held by current osd,
    and these PeeringOp _add_slot_waiter()
(3) shard-queue become empty and three shard-threads cond.wait()
(4) new osdmap consume and it _wake_pg_slot()
    Problem in here
1> OSDShard::consume() exec loop all pg's slot wait
     and requeue more than one PeeringOp to shard-queue
        2> but it only notify one shard-thread to wakeup,
           the other two shard-threads continue cond.wait()
3> OSD::ShardedOpWQ::_enqueue() found the shard-queue not empty
   and not notify all shard-thread to wakeup

     In a period of time, only one shard-thread of 3 shard-threads is running.

Fixes: https://tracker.ceph.com/issues/52781
Signed-off-by: Jianwei Zhang <jianwei1216@qq.com>
Change-Id: I4617db2fd95082007e6d9fa2b60f17f2a6296b5b
(cherry picked from commit 566b60b3f6528f491da6c2b862142ca55c05646f)
src/osd/OSD.cc
src/osd/OSD.h