minor changes
This commit is contained in:
parent
a973ad3ff4
commit
c2eadc2706
|
@ -32,6 +32,8 @@ extern "C" {
|
|||
/* ------------------------ TYPES EXPOSED ------------------------ */
|
||||
typedef struct SVnode SVnode;
|
||||
typedef struct SVnodeCfg {
|
||||
int32_t vgId;
|
||||
|
||||
/** vnode buffer pool options */
|
||||
struct {
|
||||
/** write buffer size */
|
||||
|
|
|
@ -412,7 +412,10 @@ static void *dnodeOpenVnodeFunc(void *param) {
|
|||
pMgmt->openVnodes, pMgmt->totalVnodes);
|
||||
dndReportStartup(pDnode, "open-vnodes", stepDesc);
|
||||
|
||||
SVnode *pImpl = vnodeOpen(pCfg->path, NULL);
|
||||
SVnodeCfg vnodeCfg = {0};
|
||||
vnodeCfg.vgId = pCfg->vgId;
|
||||
|
||||
SVnode *pImpl = vnodeOpen(pCfg->path, &vnodeCfg);
|
||||
if (pImpl == NULL) {
|
||||
dError("vgId:%d, failed to open vnode by thread:%d", pCfg->vgId, pThread->threadIndex);
|
||||
pThread->failed++;
|
||||
|
@ -550,6 +553,7 @@ static SCreateVnodeMsg *dndParseCreateVnodeReq(SRpcMsg *rpcMsg) {
|
|||
}
|
||||
|
||||
static void dndGenerateVnodeCfg(SCreateVnodeMsg *pCreate, SVnodeCfg *pCfg) {
|
||||
pCfg->vgId = pCreate->vgId;
|
||||
pCfg->wsize = pCreate->cacheBlockSize;
|
||||
pCfg->ssize = pCreate->cacheBlockSize;
|
||||
pCfg->wsize = pCreate->cacheBlockSize;
|
||||
|
@ -610,7 +614,7 @@ int32_t dndProcessCreateVnodeReq(SDnode *pDnode, SRpcMsg *rpcMsg) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
SVnode *pImpl = vnodeOpen(wrapperCfg.path, NULL /*pCfg*/);
|
||||
SVnode *pImpl = vnodeOpen(wrapperCfg.path, &vnodeCfg);
|
||||
if (pImpl == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
|
|
@ -20,13 +20,12 @@ static void vnodeFree(SVnode *pVnode);
|
|||
static int vnodeOpenImpl(SVnode *pVnode);
|
||||
static void vnodeCloseImpl(SVnode *pVnode);
|
||||
|
||||
SVnode *vnodeOpen(const char *path, const SVnodeCfg *pVnodeCfg) {
|
||||
SVnode *vnodeOpen(const char *path, const SVnodeCfg *pVnodeCfgInput) {
|
||||
SVnode *pVnode = NULL;
|
||||
|
||||
// Set default options
|
||||
if (pVnodeCfg == NULL) {
|
||||
pVnodeCfg = &defaultVnodeOptions;
|
||||
}
|
||||
SVnodeCfg *pVnodeCfg = &defaultVnodeOptions;
|
||||
pVnodeCfg->vgId = pVnodeCfg->vgId;
|
||||
|
||||
// Validate options
|
||||
if (vnodeValidateOptions(pVnodeCfg) < 0) {
|
||||
|
|
Loading…
Reference in New Issue