Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
eb8c0ee0
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看板
提交
eb8c0ee0
编写于
12月 31, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-2626
上级
1170afdb
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
66 addition
and
7 deletion
+66
-7
src/plugins/http/src/httpResp.c
src/plugins/http/src/httpResp.c
+27
-6
tests/script/unique/db/replica_reduce31.sim
tests/script/unique/db/replica_reduce31.sim
+39
-1
未找到文件。
src/plugins/http/src/httpResp.c
浏览文件 @
eb8c0ee0
...
@@ -50,9 +50,16 @@ static void httpSendErrorRespImp(HttpContext *pContext, int32_t httpCode, char *
...
@@ -50,9 +50,16 @@ static void httpSendErrorRespImp(HttpContext *pContext, int32_t httpCode, char *
char
head
[
512
]
=
{
0
};
char
head
[
512
]
=
{
0
};
char
body
[
512
]
=
{
0
};
char
body
[
512
]
=
{
0
};
int8_t
httpVersion
=
0
;
int8_t
keepAlive
=
0
;
if
(
pContext
->
parser
!=
NULL
)
{
httpVersion
=
pContext
->
parser
->
httpVersion
;
keepAlive
=
pContext
->
parser
->
keepAlive
;
}
int32_t
bodyLen
=
sprintf
(
body
,
httpRespTemplate
[
HTTP_RESPONSE_JSON_ERROR
],
errNo
,
desc
);
int32_t
bodyLen
=
sprintf
(
body
,
httpRespTemplate
[
HTTP_RESPONSE_JSON_ERROR
],
errNo
,
desc
);
int32_t
headLen
=
sprintf
(
head
,
httpRespTemplate
[
HTTP_RESPONSE_ERROR
],
httpVersionStr
[
pContext
->
parser
->
httpVersion
]
,
int32_t
headLen
=
sprintf
(
head
,
httpRespTemplate
[
HTTP_RESPONSE_ERROR
],
httpVersionStr
[
httpVersion
],
httpCode
,
httpCode
,
httpCodeStr
,
httpKeepAliveStr
[
pContext
->
parser
->
keepAlive
],
bodyLen
);
httpCode
Str
,
httpKeepAliveStr
[
keepAlive
],
bodyLen
);
httpWriteBuf
(
pContext
,
head
,
headLen
);
httpWriteBuf
(
pContext
,
head
,
headLen
);
httpWriteBuf
(
pContext
,
body
,
bodyLen
);
httpWriteBuf
(
pContext
,
body
,
bodyLen
);
...
@@ -164,9 +171,16 @@ void httpSendSuccResp(HttpContext *pContext, char *desc) {
...
@@ -164,9 +171,16 @@ void httpSendSuccResp(HttpContext *pContext, char *desc) {
char
head
[
1024
]
=
{
0
};
char
head
[
1024
]
=
{
0
};
char
body
[
1024
]
=
{
0
};
char
body
[
1024
]
=
{
0
};
int8_t
httpVersion
=
0
;
int8_t
keepAlive
=
0
;
if
(
pContext
->
parser
!=
NULL
)
{
httpVersion
=
pContext
->
parser
->
httpVersion
;
keepAlive
=
pContext
->
parser
->
keepAlive
;
}
int32_t
bodyLen
=
sprintf
(
body
,
httpRespTemplate
[
HTTP_RESPONSE_JSON_OK
],
TSDB_CODE_SUCCESS
,
desc
);
int32_t
bodyLen
=
sprintf
(
body
,
httpRespTemplate
[
HTTP_RESPONSE_JSON_OK
],
TSDB_CODE_SUCCESS
,
desc
);
int32_t
headLen
=
sprintf
(
head
,
httpRespTemplate
[
HTTP_RESPONSE_OK
],
httpVersionStr
[
pContext
->
parser
->
httpVersion
],
int32_t
headLen
=
sprintf
(
head
,
httpRespTemplate
[
HTTP_RESPONSE_OK
],
httpVersionStr
[
httpVersion
],
httpKeepAliveStr
[
pContext
->
parser
->
keepAlive
],
bodyLen
);
httpKeepAliveStr
[
keepAlive
],
bodyLen
);
httpWriteBuf
(
pContext
,
head
,
headLen
);
httpWriteBuf
(
pContext
,
head
,
headLen
);
httpWriteBuf
(
pContext
,
body
,
bodyLen
);
httpWriteBuf
(
pContext
,
body
,
bodyLen
);
...
@@ -177,9 +191,16 @@ void httpSendOptionResp(HttpContext *pContext, char *desc) {
...
@@ -177,9 +191,16 @@ void httpSendOptionResp(HttpContext *pContext, char *desc) {
char
head
[
1024
]
=
{
0
};
char
head
[
1024
]
=
{
0
};
char
body
[
1024
]
=
{
0
};
char
body
[
1024
]
=
{
0
};
int8_t
httpVersion
=
0
;
int8_t
keepAlive
=
0
;
if
(
pContext
->
parser
!=
NULL
)
{
httpVersion
=
pContext
->
parser
->
httpVersion
;
keepAlive
=
pContext
->
parser
->
keepAlive
;
}
int32_t
bodyLen
=
sprintf
(
body
,
httpRespTemplate
[
HTTP_RESPONSE_JSON_OK
],
TSDB_CODE_SUCCESS
,
desc
);
int32_t
bodyLen
=
sprintf
(
body
,
httpRespTemplate
[
HTTP_RESPONSE_JSON_OK
],
TSDB_CODE_SUCCESS
,
desc
);
int32_t
headLen
=
sprintf
(
head
,
httpRespTemplate
[
HTTP_RESPONSE_OPTIONS
],
httpVersionStr
[
pContext
->
parser
->
httpVersion
],
int32_t
headLen
=
sprintf
(
head
,
httpRespTemplate
[
HTTP_RESPONSE_OPTIONS
],
httpVersionStr
[
httpVersion
],
httpKeepAliveStr
[
pContext
->
parser
->
keepAlive
],
bodyLen
);
httpKeepAliveStr
[
keepAlive
],
bodyLen
);
httpWriteBuf
(
pContext
,
head
,
headLen
);
httpWriteBuf
(
pContext
,
head
,
headLen
);
httpWriteBuf
(
pContext
,
body
,
bodyLen
);
httpWriteBuf
(
pContext
,
body
,
bodyLen
);
...
...
tests/script/unique/db/replica_reduce31.sim
浏览文件 @
eb8c0ee0
...
@@ -99,9 +99,11 @@ print ========= step2 alter db
...
@@ -99,9 +99,11 @@ print ========= step2 alter db
sql_error alter database d1 replica 1
sql_error alter database d1 replica 1
sql_error alter database d2 replica 1
sql_error alter database d2 replica 1
sql_error alter database d3 replica 1
sql_error alter database d3 replica 1
sql_error alter database d4 replica 1
sql alter database d1 replica 2
sql alter database d1 replica 2
sql alter database d2 replica 2
sql alter database d2 replica 2
sql alter database d3 replica 2
sql alter database d3 replica 2
sql alter database d4 replica 2
$x = 0
$x = 0
a2:
a2:
...
@@ -129,9 +131,16 @@ if $data03 != 2 then
...
@@ -129,9 +131,16 @@ if $data03 != 2 then
goto a2
goto a2
endi
endi
sql show d4.vgroups
print online vnodes $data03
if $data03 != 2 then
goto a2
endi
sql alter database d1 replica 1
sql alter database d1 replica 1
sql alter database d2 replica 1
sql alter database d2 replica 1
sql alter database d3 replica 1
sql alter database d3 replica 1
sql alter database d4 replica 1
$x = 0
$x = 0
a1:
a1:
...
@@ -159,6 +168,27 @@ if $data03 != 1 then
...
@@ -159,6 +168,27 @@ if $data03 != 1 then
goto a1
goto a1
endi
endi
sql show d4.vgroups
print online vnodes $data03
if $data03 != 1 then
goto a1
endi
sql show dnodes
print $data00 $data01 $data02 $data03
print $data10 $data11 $data12 $data13
print $data20 $data21 $data22 $data23
if $data02 != 0 then
goto a1
endi
if $data12 != 2 then
goto a1
endi
if $data22 != 2 then
goto a1
endi
print ========= step3
print ========= step3
sql reset query cache
sql reset query cache
sleep 100
sleep 100
...
@@ -192,6 +222,7 @@ print ========= step4 alter db
...
@@ -192,6 +222,7 @@ print ========= step4 alter db
sql alter database d1 replica 2
sql alter database d1 replica 2
sql alter database d2 replica 2
sql alter database d2 replica 2
sql alter database d3 replica 2
sql alter database d3 replica 2
sql alter database d4 replica 2
$x = 0
$x = 0
step4:
step4:
...
@@ -219,6 +250,12 @@ if $data03 != 2 then
...
@@ -219,6 +250,12 @@ if $data03 != 2 then
goto step4
goto step4
endi
endi
sql show d4.vgroups
print online vnodes $data03
if $data03 != 2 then
goto step4
endi
sql insert into d1.t1 values(now, 3)
sql insert into d1.t1 values(now, 3)
sql insert into d2.t2 values(now, 3)
sql insert into d2.t2 values(now, 3)
sql insert into d3.t3 values(now, 3)
sql insert into d3.t3 values(now, 3)
...
@@ -286,4 +323,5 @@ sql select * from d4.t4
...
@@ -286,4 +323,5 @@ sql select * from d4.t4
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/exec.sh -n dnode3 -s stop -x SIGINT
system sh/exec.sh -n dnode3 -s stop -x SIGINT
\ No newline at end of file
system sh/exec.sh -n dnode4 -s stop -x SIGINT
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录