Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yiicenne
TDengine
提交
8f886b89
TDengine
项目概览
yiicenne
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
8f886b89
编写于
8月 11, 2020
作者:
S
Shengliang Guan
提交者:
GitHub
8月 11, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #3011 from taosdata/feature/os
Feature/os
上级
686baf48
3b8b8414
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
21 addition
and
15 deletion
+21
-15
src/balance/src/balance.c
src/balance/src/balance.c
+10
-8
src/mnode/src/mnodeProfile.c
src/mnode/src/mnodeProfile.c
+2
-2
src/mnode/src/mnodeShow.c
src/mnode/src/mnodeShow.c
+4
-2
src/plugins/http/src/httpContext.c
src/plugins/http/src/httpContext.c
+4
-2
src/plugins/http/src/httpSession.c
src/plugins/http/src/httpSession.c
+1
-1
未找到文件。
src/balance/src/balance.c
浏览文件 @
8f886b89
...
...
@@ -214,8 +214,8 @@ static bool balanceCheckVgroupReady(SVgObj *pVgroup, SVnodeGid *pRmVnode) {
* desc: remove one vnode from vgroup
* all vnodes in vgroup should in ready state, except the balancing one
**/
static
void
balanceRemoveVnode
(
SVgObj
*
pVgroup
)
{
if
(
pVgroup
->
numOfVnodes
<=
1
)
return
;
static
int32_t
balanceRemoveVnode
(
SVgObj
*
pVgroup
)
{
if
(
pVgroup
->
numOfVnodes
<=
1
)
return
-
1
;
SVnodeGid
*
pRmVnode
=
NULL
;
SVnodeGid
*
pSelVnode
=
NULL
;
...
...
@@ -258,9 +258,11 @@ static void balanceRemoveVnode(SVgObj *pVgroup) {
if
(
!
balanceCheckVgroupReady
(
pVgroup
,
pSelVnode
))
{
mDebug
(
"vgId:%d, is not ready"
,
pVgroup
->
vgId
);
return
-
1
;
}
else
{
mDebug
(
"vgId:%d, is ready, discard dnode:%d"
,
pVgroup
->
vgId
,
pSelVnode
->
dnodeId
);
balanceDiscardVnode
(
pVgroup
,
pSelVnode
);
return
TSDB_CODE_SUCCESS
;
}
}
...
...
@@ -407,22 +409,22 @@ static int32_t balanceMonitorVgroups() {
int32_t
dbReplica
=
pVgroup
->
pDb
->
cfg
.
replications
;
int32_t
vgReplica
=
pVgroup
->
numOfVnodes
;
int32_t
code
=
-
1
;
if
(
vgReplica
>
dbReplica
)
{
mInfo
(
"vgId:%d, replica:%d numOfVnodes:%d, try remove one vnode"
,
pVgroup
->
vgId
,
dbReplica
,
vgReplica
);
hasUpdatingVgroup
=
true
;
balanceRemoveVnode
(
pVgroup
);
code
=
balanceRemoveVnode
(
pVgroup
);
}
else
if
(
vgReplica
<
dbReplica
)
{
mInfo
(
"vgId:%d, replica:%d numOfVnodes:%d, try add one vnode"
,
pVgroup
->
vgId
,
dbReplica
,
vgReplica
);
hasUpdatingVgroup
=
true
;
int32_t
code
=
balanceAddVnode
(
pVgroup
,
NULL
,
NULL
);
if
(
code
==
TSDB_CODE_SUCCESS
)
{
mnodeDecVgroupRef
(
pVgroup
);
break
;
}
code
=
balanceAddVnode
(
pVgroup
,
NULL
,
NULL
);
}
mnodeDecVgroupRef
(
pVgroup
);
if
(
code
==
TSDB_CODE_SUCCESS
)
{
break
;
}
}
sdbFreeIter
(
pIter
);
...
...
src/mnode/src/mnodeProfile.c
浏览文件 @
8f886b89
...
...
@@ -35,8 +35,8 @@
#include "mnodeVgroup.h"
#include "mnodeWrite.h"
#define CONN_KEEP_TIME (tsShellActivityTimer * 3)
#define CONN_CHECK_TIME (tsShellActivityTimer * 2)
#define CONN_KEEP_TIME (tsShellActivityTimer * 3
000
)
#define CONN_CHECK_TIME (tsShellActivityTimer * 2
000
)
#define QUERY_ID_SIZE 20
#define QUERY_STREAM_SAVE_SIZE 20
...
...
src/mnode/src/mnodeShow.c
浏览文件 @
8f886b89
...
...
@@ -377,7 +377,8 @@ static bool mnodeCheckShowFinished(SShowObj *pShow) {
}
static
bool
mnodeAccquireShowObj
(
SShowObj
*
pShow
)
{
SShowObj
**
ppShow
=
taosCacheAcquireByKey
(
tsMnodeShowCache
,
&
pShow
,
sizeof
(
int64_t
));
uint64_t
handleVal
=
(
uint64_t
)
pShow
;
SShowObj
**
ppShow
=
taosCacheAcquireByKey
(
tsMnodeShowCache
,
&
handleVal
,
sizeof
(
int64_t
));
if
(
ppShow
)
{
mDebug
(
"%p, show is accquired from cache, data:%p, index:%d"
,
pShow
,
ppShow
,
pShow
->
index
);
return
true
;
...
...
@@ -389,7 +390,8 @@ static bool mnodeAccquireShowObj(SShowObj *pShow) {
static
void
*
mnodePutShowObj
(
SShowObj
*
pShow
)
{
if
(
tsMnodeShowCache
!=
NULL
)
{
pShow
->
index
=
atomic_add_fetch_32
(
&
tsShowObjIndex
,
1
);
SShowObj
**
ppShow
=
taosCachePut
(
tsMnodeShowCache
,
&
pShow
,
sizeof
(
int64_t
),
&
pShow
,
sizeof
(
int64_t
),
6
);
uint64_t
handleVal
=
(
uint64_t
)
pShow
;
SShowObj
**
ppShow
=
taosCachePut
(
tsMnodeShowCache
,
&
handleVal
,
sizeof
(
int64_t
),
&
pShow
,
sizeof
(
int64_t
),
6000
);
pShow
->
ppShow
=
(
void
**
)
ppShow
;
mDebug
(
"%p, show is put into cache, data:%p index:%d"
,
pShow
,
ppShow
,
pShow
->
index
);
return
pShow
;
...
...
src/plugins/http/src/httpContext.c
浏览文件 @
8f886b89
...
...
@@ -108,7 +108,8 @@ HttpContext *httpCreateContext(int32_t fd) {
pContext
->
lastAccessTime
=
taosGetTimestampSec
();
pContext
->
state
=
HTTP_CONTEXT_STATE_READY
;
HttpContext
**
ppContext
=
taosCachePut
(
tsHttpServer
.
contextCache
,
&
pContext
,
sizeof
(
int64_t
),
&
pContext
,
sizeof
(
int64_t
),
3
);
uint64_t
handleVal
=
(
uint64_t
)
pContext
;
HttpContext
**
ppContext
=
taosCachePut
(
tsHttpServer
.
contextCache
,
&
handleVal
,
sizeof
(
int64_t
),
&
pContext
,
sizeof
(
int64_t
),
3000
);
pContext
->
ppContext
=
ppContext
;
httpDebug
(
"context:%p, fd:%d, is created, data:%p"
,
pContext
,
fd
,
ppContext
);
...
...
@@ -119,7 +120,8 @@ HttpContext *httpCreateContext(int32_t fd) {
}
HttpContext
*
httpGetContext
(
void
*
ptr
)
{
HttpContext
**
ppContext
=
taosCacheAcquireByKey
(
tsHttpServer
.
contextCache
,
&
ptr
,
sizeof
(
HttpContext
*
));
uint64_t
handleVal
=
(
uint64_t
)
ptr
;
HttpContext
**
ppContext
=
taosCacheAcquireByKey
(
tsHttpServer
.
contextCache
,
&
handleVal
,
sizeof
(
HttpContext
*
));
if
(
ppContext
)
{
HttpContext
*
pContext
=
*
ppContext
;
...
...
src/plugins/http/src/httpSession.c
浏览文件 @
8f886b89
...
...
@@ -34,7 +34,7 @@ void httpCreateSession(HttpContext *pContext, void *taos) {
session
.
refCount
=
1
;
int32_t
len
=
snprintf
(
session
.
id
,
HTTP_SESSION_ID_LEN
,
"%s.%s"
,
pContext
->
user
,
pContext
->
pass
);
pContext
->
session
=
taosCachePut
(
server
->
sessionCache
,
session
.
id
,
len
,
&
session
,
sizeof
(
HttpSession
),
tsHttpSessionExpire
);
pContext
->
session
=
taosCachePut
(
server
->
sessionCache
,
session
.
id
,
len
,
&
session
,
sizeof
(
HttpSession
),
tsHttpSessionExpire
*
1000
);
// void *temp = pContext->session;
// taosCacheRelease(server->sessionCache, (void **)&temp, false);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录