提交 44915af5 编写于 作者: H Hongze Cheng

more code

上级 d0df914d
......@@ -85,6 +85,8 @@ typedef struct SSnapDataHdr SSnapDataHdr;
#define VNODE_RSMA1_DIR "rsma1"
#define VNODE_RSMA2_DIR "rsma2"
#define VNODE_BUF_POOL_SEG 1 // TODO: change parameter here for sync/async commit
// vnd.h
void* vnodeBufPoolMalloc(SVBufPool* pPool, int size);
void vnodeBufPoolFree(SVBufPool* pPool, void* p);
......
......@@ -26,9 +26,9 @@ int vnodeOpenBufPool(SVnode *pVnode, int64_t size) {
ASSERT(pVnode->pPool == NULL);
for (int i = 0; i < 3; i++) {
for (int i = 0; i < VNODE_BUF_POOL_SEG; i++) {
// create pool
ret = vnodeBufPoolCreate(pVnode, size, &pPool);
ret = vnodeBufPoolCreate(pVnode, size / VNODE_BUF_POOL_SEG, &pPool);
if (ret < 0) {
vError("vgId:%d, failed to open vnode buffer pool since %s", TD_VID(pVnode), tstrerror(terrno));
vnodeCloseBufPool(pVnode);
......
......@@ -73,7 +73,7 @@ int vnodeBegin(SVnode *pVnode) {
int vnodeShouldCommit(SVnode *pVnode) {
if (pVnode->inUse) {
return pVnode->inUse->size > pVnode->config.szBuf / 3;
return pVnode->inUse->size > pVnode->config.szBuf / VNODE_BUF_POOL_SEG;
}
return false;
}
......@@ -236,7 +236,7 @@ int vnodeCommit(SVnode *pVnode) {
// preCommit
// smaSyncPreCommit(pVnode->pSma);
if(smaAsyncPreCommit(pVnode->pSma) < 0){
if (smaAsyncPreCommit(pVnode->pSma) < 0) {
ASSERT(0);
return -1;
}
......
......@@ -96,7 +96,7 @@ SVnode *vnodeOpen(const char *path, STfs *pTfs, SMsgCb msgCb) {
taosThreadCondInit(&pVnode->poolNotEmpty, NULL);
// open buffer pool
if (vnodeOpenBufPool(pVnode, pVnode->config.isHeap ? 0 : pVnode->config.szBuf / 3) < 0) {
if (vnodeOpenBufPool(pVnode, pVnode->config.szBuf) < 0) {
vError("vgId:%d, failed to open vnode buffer pool since %s", TD_VID(pVnode), tstrerror(terrno));
goto _err;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册