doc001

Results 124 comments of doc001

流控可以依赖pending的任务数量(自己在代码里用bvar统计,或者检查status页面rpc请求的processing的统计)来做,这里的case,应该会有一个不断增加的过程

你们是开启了 usercode_in_pthread或者混用了其他的线程池? futex_wait_private 这个说明是在普通pthread线程里持有了锁,这个时候butex会退化成futex。如果是混用了其他的线程池,可以主动发起一个bthread去执行操作,切换到bthread线程池里

braft::SegmentLogStorage::get_segment (this=0x7f6f7d45af70, group_id=12638, index=62666) 看起来根源是这个锁,这里有做改动吗? 这儿有个嵌套。replicator 的 bthread id lock 里会去拿 Segment 的锁。Node 里有周期性的定时器会拿 replicator的 bthread id lock(获取 last_rpc_send_timestamp),Segment 锁住会造成整个 node 的锁竞争。这个地方目前在内部版本已经改了,还没同步过来。不过这个锁竞争仍然是 butex 的,不应该占住线程,主要还是看 get_segment 为什么会锁住。

``` void NodeImpl::apply(const Task& task) { LogEntry* entry = new LogEntry; entry->AddRef(); entry->data.swap(*task.data); LogEntryAndClosure m; m.entry = entry; m.done = task.done; m.expected_term = task.expected_term; if (_apply_queue->execute(m, &bthread::TASK_OPTIONS_INPLACE, NULL) != 0)...

``` int butex_wait(void* arg, int expected_value, const timespec* abstime) { ... TaskGroup* g = tls_task_group; if (NULL == g || g->is_current_pthread_task()) { return butex_wait_from_pthread(g, b, expected_value, abstime); } ``` brpc...

> @PFZheng 大佬有v没,我也在BJ,我们比较着急,可以当面聊聊么 你往我的邮箱发一个邮件吧,告知一下微信号,我加一下你: [email protected]

> ``` > int butex_wait(void* arg, int expected_value, const timespec* abstime) { > ... > TaskGroup* g = tls_task_group; > if (NULL == g || g->is_current_pthread_task()) { > return butex_wait_from_pthread(g,...

> > braft::SegmentLogStorage::get_segment (this=0x7f6f7d45af70, group_id=12638, index=62666) 看起来根源是这个锁,这里有做改动吗? > > 这儿有个嵌套。replicator 的 bthread id lock 里会去拿 Segment 的锁。Node 里有周期性的定时器会拿 replicator的 bthread id lock(获取 last_rpc_send_timestamp),Segment 锁住会造成整个 node 的锁竞争。这个地方目前在内部版本已经改了,还没同步过来。不过这个锁竞争仍然是 butex 的,不应该占住线程,主要还是看 get_segment 为什么会锁住。...

> > > > braft::SegmentLogStorage::get_segment (this=0x7f6f7d45af70, group_id=12638, index=62666) 看起来根源是这个锁,这里有做改动吗? > > > > 这儿有个嵌套。replicator 的 bthread id lock 里会去拿 Segment 的锁。Node 里有周期性的定时器会拿 replicator的 bthread id lock(获取 last_rpc_send_timestamp),Segment 锁住会造成整个 node 的锁竞争。这个地方目前在内部版本已经改了,还没同步过来。不过这个锁竞争仍然是...