GitHub user guyu0000 edited a discussion: [REJECTREQUEST]system busy, start 
flow control for a while

现象:
1. 运行一段时间后客户端一直报这个错误,只有重启broker才能恢复
2. 未重启前,在store目录看到有两个`commitLog`,重启完后,原有的commitLog丢了
3. `watch org.apache.rocketmq.store.DefaultMessageStore 
isTransientStorePoolDeficient` 发现结果一直为 `false`
源码:
```java
//org.apache.rocketmq.store.TransientStorePool
public int remainBufferNumbs() {
    if (storeConfig.isTransientStorePoolEnable()) {
        return availableBuffers.size(); //返回 0,说明buffer没有了
    }
    return Integer.MAX_VALUE;
}
//归还buffer
public void returnBuffer(ByteBuffer byteBuffer) {
    byteBuffer.position(0);
    byteBuffer.limit(fileSize);
    this.availableBuffers.offerFirst(byteBuffer);
}
//org.apache.rocketmq.store.MappedFile
public int commit(final int commitLeastPages) {
//...
        if (writeBuffer != null && this.transientStorePool != null && 
this.fileSize == this.committedPosition.get()) {
            this.transientStorePool.returnBuffer(writeBuffer);
            this.writeBuffer = null;
        }
//...
}
```
请教下:
想确认,从现象、源码 看是不是没有归还buffer?MappedFile是不是没有commit到?一般什么情况下会导致,buffer的可用数一直为 0

---
配置:
```
brokerName = broker-a
brokerId = 0
brokerRole = ASYNC_MASTER
flushDiskType = ASYNC_FLUSH
autoCreateTopicEnable=false
autoCreateSubscriptionGroup=false
sendMessageThreadPoolNums=64
useReentrantLockWhenPutMessage=true
traceTopicEnable=true
slaveReadEnable=true
waitTimeMillsInSendQueue=500
messageDelayLevel=1s 5s 10s 30s 1m 5m 10m 30m 1h 2h
transientStorePoolEnable=true
osPageCacheBusyTimeOutMills=1500
transientStorePoolSize=2
#其他默认配置
```
机器:8C16G
主要JVM参数: -Xmx8g -Xms8g -Xmn4g

GitHub link: https://github.com/apache/rocketmq/discussions/6821

----
This is an automatically sent email for dev@rocketmq.apache.org.
To unsubscribe, please send an email to: dev-unsubscr...@rocketmq.apache.org

Reply via email to