Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
2d0396e9
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看板
提交
2d0396e9
编写于
4月 08, 2020
作者:
S
slguan
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/feature/sync' into feature/balance
上级
76d4cdf8
4f6cb328
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
13 addition
and
16 deletion
+13
-16
src/inc/tsync.h
src/inc/tsync.h
+7
-10
tests/script/general/table/basic1.sim
tests/script/general/table/basic1.sim
+3
-3
tests/script/general/table/basic3.sim
tests/script/general/table/basic3.sim
+3
-3
未找到文件。
src/inc/tsync.h
浏览文件 @
2d0396e9
...
@@ -56,15 +56,12 @@ typedef struct {
...
@@ -56,15 +56,12 @@ typedef struct {
}
SNodesRole
;
}
SNodesRole
;
typedef
struct
{
typedef
struct
{
char
label
[
20
];
// for debug purpose
char
path
[
128
];
// path to the file
int8_t
replica
;
// number of replications, >=1
int8_t
quorum
;
// number of confirms required, >=1
int32_t
vgId
;
// vgroup ID
int32_t
vgId
;
// vgroup ID
void
*
ahandle
;
// handle provided by APP
uint64_t
version
;
// initial version
uint64_t
version
;
// initial version
uint32_t
arbitratorIp
;
SSyncCfg
syncCfg
;
// configuration from mgmt
SNodeInfo
nodeInfo
[
TAOS_SYNC_MAX_REPLICA
];
char
path
[
128
];
// path to the file
void
*
ahandle
;
// handle provided by APP
// if name is null, get the file from index or after, used by master
// if name is null, get the file from index or after, used by master
// if name is provided, get the named file at the specified index, used by unsynced node
// if name is provided, get the named file at the specified index, used by unsynced node
...
@@ -76,7 +73,7 @@ typedef struct {
...
@@ -76,7 +73,7 @@ typedef struct {
int
(
*
getWalInfo
)(
char
*
name
,
int
*
index
);
int
(
*
getWalInfo
)(
char
*
name
,
int
*
index
);
// when a forward pkt is received, call this to handle data
// when a forward pkt is received, call this to handle data
int
(
*
writeToCache
)(
void
*
ahandle
,
SWalHead
*
,
int
type
);
int
(
*
writeToCache
)(
void
*
ahandle
,
void
*
pHead
,
int
type
);
// when forward is confirmed by peer, master call this API to notify app
// when forward is confirmed by peer, master call this API to notify app
void
(
*
confirmForward
)(
void
*
ahandle
,
void
*
mhandle
,
int32_t
code
);
void
(
*
confirmForward
)(
void
*
ahandle
,
void
*
mhandle
,
int32_t
code
);
...
@@ -89,8 +86,8 @@ typedef void* tsync_h;
...
@@ -89,8 +86,8 @@ typedef void* tsync_h;
tsync_h
syncStart
(
SSyncInfo
*
);
tsync_h
syncStart
(
SSyncInfo
*
);
void
syncStop
(
tsync_h
shandle
);
void
syncStop
(
tsync_h
shandle
);
int
syncReconfig
(
tsync_h
shandle
,
SSync
Info
*
);
int
syncReconfig
(
tsync_h
shandle
,
SSync
Cfg
*
);
int
syncForwardToPeer
(
tsync_h
shandle
,
SWalHea
d
*
pHead
,
void
*
mhandle
);
int
syncForwardToPeer
(
tsync_h
shandle
,
voi
d
*
pHead
,
void
*
mhandle
);
void
syncConfirmForward
(
tsync_h
shandle
,
uint64_t
version
,
int32_t
code
);
void
syncConfirmForward
(
tsync_h
shandle
,
uint64_t
version
,
int32_t
code
);
void
syncRecover
(
tsync_h
shandle
);
// recover from other nodes:
void
syncRecover
(
tsync_h
shandle
);
// recover from other nodes:
int
syncGetNodesRole
(
tsync_h
shandle
,
SNodesRole
*
);
int
syncGetNodesRole
(
tsync_h
shandle
,
SNodesRole
*
);
...
...
tests/script/general/table/basic1.sim
浏览文件 @
2d0396e9
...
@@ -43,9 +43,9 @@ print $data10 $data11 $data22
...
@@ -43,9 +43,9 @@ print $data10 $data11 $data22
print $data20 $data11 $data22
print $data20 $data11 $data22
print =============== insert data
print =============== insert data
sql insert into d1.n1 values(now, 1)
sql insert into d1.n1 values(now
+1s
, 1)
sql insert into d1.n1 values(now, 2)
sql insert into d1.n1 values(now
+2s
, 2)
sql insert into d1.n1 values(now, 3)
sql insert into d1.n1 values(now
+3s
, 3)
print =============== query data
print =============== query data
sql select * from d1.n1
sql select * from d1.n1
...
...
tests/script/general/table/basic3.sim
浏览文件 @
2d0396e9
...
@@ -43,9 +43,9 @@ print $data10 $data11 $data22
...
@@ -43,9 +43,9 @@ print $data10 $data11 $data22
print $data20 $data11 $data22
print $data20 $data11 $data22
print =============== insert data
print =============== insert data
sql insert into db.n1 values(now, 1)
sql insert into db.n1 values(now
+1s
, 1)
sql insert into db.n1 values(now, 2)
sql insert into db.n1 values(now
+2s
, 2)
sql insert into db.n1 values(now, 3)
sql insert into db.n1 values(now
+3s
, 3)
print =============== query data
print =============== query data
sql select * from db.n1
sql select * from db.n1
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录