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