Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
a3272bfb
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
a3272bfb
编写于
7月 09, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
log
上级
12d2d6bf
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
61 addition
and
19 deletion
+61
-19
src/mnode/src/mnodeSdb.c
src/mnode/src/mnodeSdb.c
+18
-18
tests/script/sh/deploy.sh
tests/script/sh/deploy.sh
+1
-1
tests/script/tmp/mnodes.sim
tests/script/tmp/mnodes.sim
+42
-0
未找到文件。
src/mnode/src/mnodeSdb.c
浏览文件 @
a3272bfb
...
...
@@ -199,7 +199,7 @@ static void sdbRestoreTables() {
sdbDebug
(
"table:%s, is restored, numOfRows:%"
PRId64
,
pTable
->
tableName
,
pTable
->
numOfRows
);
}
sdbInfo
(
"sdb is restored, ver
sion
:%"
PRId64
" totalRows:%d numOfTables:%d"
,
tsSdbObj
.
version
,
totalRows
,
numOfTables
);
sdbInfo
(
"sdb is restored, ver:%"
PRId64
" totalRows:%d numOfTables:%d"
,
tsSdbObj
.
version
,
totalRows
,
numOfTables
);
}
void
sdbUpdateMnodeRoles
()
{
...
...
@@ -373,7 +373,7 @@ void sdbCleanUp() {
tsSdbObj
.
status
=
SDB_STATUS_CLOSING
;
sdbCleanupWriteWorker
();
sdbDebug
(
"sdb will be closed, ver
sion
:%"
PRId64
,
tsSdbObj
.
version
);
sdbDebug
(
"sdb will be closed, ver:%"
PRId64
,
tsSdbObj
.
version
);
if
(
tsSdbObj
.
sync
)
{
syncStop
(
tsSdbObj
.
sync
);
...
...
@@ -471,8 +471,8 @@ static int32_t sdbInsertHash(SSdbTable *pTable, SSdbOper *pOper) {
atomic_add_fetch_32
(
&
pTable
->
autoIndex
,
1
);
}
sdbDebug
(
"table:%s, insert record:%s to hash, rowSize:%d numOfRows:%"
PRId64
" ver
sion:%"
PRIu64
,
pTable
->
tableName
,
sdbGetKeyStrFromObj
(
pTable
,
pOper
->
pObj
),
pOper
->
rowSize
,
pTable
->
numOfRows
,
sdbGetVersion
());
sdbDebug
(
"table:%s, insert record:%s to hash, rowSize:%d numOfRows:%"
PRId64
" ver
:%"
PRIu64
", msg:%p"
,
pTable
->
tableName
,
sdbGetKeyStrFromObj
(
pTable
,
pOper
->
pObj
),
pOper
->
rowSize
,
pTable
->
numOfRows
,
sdbGetVersion
()
,
pOper
->
pMsg
);
(
*
pTable
->
insertFp
)(
pOper
);
return
TSDB_CODE_SUCCESS
;
...
...
@@ -490,8 +490,8 @@ static int32_t sdbDeleteHash(SSdbTable *pTable, SSdbOper *pOper) {
taosHashRemove
(
pTable
->
iHandle
,
key
,
keySize
);
atomic_sub_fetch_32
(
&
pTable
->
numOfRows
,
1
);
sdbDebug
(
"table:%s, delete record:%s from hash, numOfRows:%"
PRId64
" ver
sion:%"
PRIu64
,
pTable
->
tableName
,
sdbGetKeyStrFromObj
(
pTable
,
pOper
->
pObj
),
pTable
->
numOfRows
,
sdbGetVersion
());
sdbDebug
(
"table:%s, delete record:%s from hash, numOfRows:%"
PRId64
" ver
:%"
PRIu64
", msg:%p"
,
pTable
->
tableName
,
sdbGetKeyStrFromObj
(
pTable
,
pOper
->
pObj
),
pTable
->
numOfRows
,
sdbGetVersion
()
,
pOper
->
pMsg
);
int8_t
*
updateEnd
=
pOper
->
pObj
+
pTable
->
refCountPos
-
1
;
*
updateEnd
=
1
;
...
...
@@ -501,8 +501,8 @@ static int32_t sdbDeleteHash(SSdbTable *pTable, SSdbOper *pOper) {
}
static
int32_t
sdbUpdateHash
(
SSdbTable
*
pTable
,
SSdbOper
*
pOper
)
{
sdbDebug
(
"table:%s, update record:%s in hash, numOfRows:%"
PRId64
" ver
sion:%"
PRIu64
,
pTable
->
tableName
,
sdbGetKeyStrFromObj
(
pTable
,
pOper
->
pObj
),
pTable
->
numOfRows
,
sdbGetVersion
());
sdbDebug
(
"table:%s, update record:%s in hash, numOfRows:%"
PRId64
" ver
:%"
PRIu64
", msg:%p"
,
pTable
->
tableName
,
sdbGetKeyStrFromObj
(
pTable
,
pOper
->
pObj
),
pTable
->
numOfRows
,
sdbGetVersion
()
,
pOper
->
pMsg
);
(
*
pTable
->
updateFp
)(
pOper
);
return
TSDB_CODE_SUCCESS
;
...
...
@@ -527,12 +527,12 @@ static int sdbWrite(void *param, void *data, int type) {
// for data from WAL or forward, version may be smaller
if
(
pHead
->
version
<=
tsSdbObj
.
version
)
{
pthread_mutex_unlock
(
&
tsSdbObj
.
mutex
);
sdbDebug
(
"table:%s, failed to restore %s record:%s from source(%d), ver
sion:%"
PRId64
" too large, sdb version
:%"
PRId64
,
sdbDebug
(
"table:%s, failed to restore %s record:%s from source(%d), ver
:%"
PRId64
" too large, sdb ver
:%"
PRId64
,
pTable
->
tableName
,
sdbGetActionStr
(
action
),
sdbGetKeyStr
(
pTable
,
pHead
->
cont
),
type
,
pHead
->
version
,
tsSdbObj
.
version
);
return
TSDB_CODE_SUCCESS
;
}
else
if
(
pHead
->
version
!=
tsSdbObj
.
version
+
1
)
{
pthread_mutex_unlock
(
&
tsSdbObj
.
mutex
);
sdbError
(
"table:%s, failed to restore %s record:%s from source(%d), ver
sion:%"
PRId64
" too large, sdb version
:%"
PRId64
,
sdbError
(
"table:%s, failed to restore %s record:%s from source(%d), ver
:%"
PRId64
" too large, sdb ver
:%"
PRId64
,
pTable
->
tableName
,
sdbGetActionStr
(
action
),
sdbGetKeyStr
(
pTable
,
pHead
->
cont
),
type
,
pHead
->
version
,
tsSdbObj
.
version
);
return
TSDB_CODE_MND_APP_ERROR
;
}
else
{
...
...
@@ -556,19 +556,19 @@ static int sdbWrite(void *param, void *data, int type) {
if
(
syncCode
<=
0
)
pOper
->
processedCount
=
1
;
if
(
syncCode
<
0
)
{
sdbError
(
"table:%s, failed to forward request, result:%s action:%s record:%s ver
sion:%"
PRId64
,
pTable
->
tableName
,
tstrerror
(
syncCode
),
sdbGetActionStr
(
action
),
sdbGetKeyStr
(
pTable
,
pHead
->
cont
),
pHead
->
version
);
sdbError
(
"table:%s, failed to forward request, result:%s action:%s record:%s ver
:%"
PRId64
", msg:%p"
,
pTable
->
tableName
,
tstrerror
(
syncCode
),
sdbGetActionStr
(
action
),
sdbGetKeyStr
(
pTable
,
pHead
->
cont
),
pHead
->
version
,
pOper
->
pMsg
);
}
else
if
(
syncCode
>
0
)
{
sdbDebug
(
"table:%s, forward request is sent, action:%s record:%s ver
sion:%"
PRId64
,
pTable
->
tableName
,
sdbGetActionStr
(
action
),
sdbGetKeyStr
(
pTable
,
pHead
->
cont
),
pHead
->
version
);
sdbDebug
(
"table:%s, forward request is sent, action:%s record:%s ver
:%"
PRId64
", msg:%p"
,
pTable
->
tableName
,
sdbGetActionStr
(
action
),
sdbGetKeyStr
(
pTable
,
pHead
->
cont
),
pHead
->
version
,
pOper
->
pMsg
);
}
else
{
sdbTrace
(
"table:%s, no need to send fwd request, action:%s record:%s ver
sion:%"
PRId64
,
pTable
->
tableName
,
sdbGetActionStr
(
action
),
sdbGetKeyStr
(
pTable
,
pHead
->
cont
),
pHead
->
version
);
sdbTrace
(
"table:%s, no need to send fwd request, action:%s record:%s ver
:%"
PRId64
", msg:%p"
,
pTable
->
tableName
,
sdbGetActionStr
(
action
),
sdbGetKeyStr
(
pTable
,
pHead
->
cont
),
pHead
->
version
,
pOper
->
pMsg
);
}
return
syncCode
;
}
sdbDebug
(
"table:%s, record from wal/fwd is disposed, action:%s record:%s ver
sion
:%"
PRId64
,
pTable
->
tableName
,
sdbDebug
(
"table:%s, record from wal/fwd is disposed, action:%s record:%s ver:%"
PRId64
,
pTable
->
tableName
,
sdbGetActionStr
(
action
),
sdbGetKeyStr
(
pTable
,
pHead
->
cont
),
pHead
->
version
);
// even it is WAL/FWD, it shall be called to update version in sync
...
...
@@ -957,7 +957,7 @@ static void *sdbWorkerFp(void *param) {
pOper
->
processedCount
=
1
;
pHead
=
(
void
*
)
pOper
+
sizeof
(
SSdbOper
)
+
SDB_SYNC_HACK
;
if
(
pOper
->
pMsg
!=
NULL
)
{
sdbDebug
(
"app:%p:%p, table:%s record:%p:%s ver
sion
:%"
PRIu64
", will be processed in sdb queue"
,
sdbDebug
(
"app:%p:%p, table:%s record:%p:%s ver:%"
PRIu64
", will be processed in sdb queue"
,
pOper
->
pMsg
->
rpcMsg
.
ahandle
,
pOper
->
pMsg
,
((
SSdbTable
*
)
pOper
->
table
)
->
tableName
,
pOper
->
pObj
,
sdbGetKeyStr
(
pOper
->
table
,
pHead
->
cont
),
pHead
->
version
);
}
...
...
tests/script/sh/deploy.sh
浏览文件 @
a3272bfb
...
...
@@ -110,7 +110,7 @@ echo "second ${HOSTNAME}:7200" >> $TAOS_CFG
echo
"serverPort
${
NODE
}
"
>>
$TAOS_CFG
echo
"dataDir
$DATA_DIR
"
>>
$TAOS_CFG
echo
"logDir
$LOG_DIR
"
>>
$TAOS_CFG
echo
"debugFlag 1
43
"
>>
$TAOS_CFG
echo
"debugFlag 1
35
"
>>
$TAOS_CFG
echo
"mDebugFlag 135"
>>
$TAOS_CFG
echo
"sdbDebugFlag 135"
>>
$TAOS_CFG
echo
"dDebugFlag 135"
>>
$TAOS_CFG
...
...
tests/script/tmp/mnodes.sim
浏览文件 @
a3272bfb
...
...
@@ -24,6 +24,48 @@ system sh/cfg.sh -n dnode1 -c http -v 1
system sh/cfg.sh -n dnode2 -c http -v 1
system sh/cfg.sh -n dnode3 -c http -v 1
system sh/cfg.sh -n dnode1 -c mDebugFlag -v 143
system sh/cfg.sh -n dnode2 -c mDebugFlag -v 143
system sh/cfg.sh -n dnode3 -c mDebugFlag -v 143
system sh/cfg.sh -n dnode1 -c sdbDebugFlag -v 143
system sh/cfg.sh -n dnode2 -c sdbDebugFlag -v 143
system sh/cfg.sh -n dnode3 -c sdbDebugFlag -v 143
system sh/cfg.sh -n dnode1 -c sdebugFlag -v 143
system sh/cfg.sh -n dnode2 -c sdebugFlag -v 143
system sh/cfg.sh -n dnode3 -c sdebugFlag -v 143
system sh/cfg.sh -n dnode1 -c rpcDebugFlag -v 135
system sh/cfg.sh -n dnode2 -c rpcDebugFlag -v 135
system sh/cfg.sh -n dnode3 -c rpcDebugFlag -v 135
system sh/cfg.sh -n dnode1 -c tsdbDebugFlag -v 131
system sh/cfg.sh -n dnode2 -c tsdbDebugFlag -v 131
system sh/cfg.sh -n dnode3 -c tsdbDebugFlag -v 131
system sh/cfg.sh -n dnode1 -c mqttDebugFlag -v 131
system sh/cfg.sh -n dnode2 -c mqttDebugFlag -v 131
system sh/cfg.sh -n dnode3 -c mqttDebugFlag -v 131
system sh/cfg.sh -n dnode1 -c qdebugFlag -v 131
system sh/cfg.sh -n dnode2 -c qdebugFlag -v 131
system sh/cfg.sh -n dnode3 -c qdebugFlag -v 131
system sh/cfg.sh -n dnode1 -c cDebugFlag -v 131
system sh/cfg.sh -n dnode2 -c cDebugFlag -v 131
system sh/cfg.sh -n dnode3 -c cDebugFlag -v 131
system sh/cfg.sh -n dnode1 -c udebugFlag -v 131
system sh/cfg.sh -n dnode2 -c udebugFlag -v 131
system sh/cfg.sh -n dnode3 -c udebugFlag -v 131
system sh/cfg.sh -n dnode1 -c wdebugFlag -v 131
system sh/cfg.sh -n dnode2 -c wdebugFlag -v 131
system sh/cfg.sh -n dnode3 -c wdebugFlag -v 131
print ============== deploy
system sh/exec.sh -n dnode1 -s start
sleep 2001
sql connect
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录