Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
feb49af4
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看板
提交
feb49af4
编写于
5月 08, 2020
作者:
S
slguan
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop' of
https://github.com/taosdata/TDengine
into develop
上级
4a54184a
e804a9c2
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
26 addition
and
9 deletion
+26
-9
src/dnode/src/dnodeMgmt.c
src/dnode/src/dnodeMgmt.c
+1
-1
src/inc/tsync.h
src/inc/tsync.h
+6
-3
src/rpc/src/rpcTcp.c
src/rpc/src/rpcTcp.c
+1
-1
src/vnode/src/vnodeMain.c
src/vnode/src/vnodeMain.c
+9
-0
src/vnode/src/vnodeWrite.c
src/vnode/src/vnodeWrite.c
+1
-1
src/wal/src/walMain.c
src/wal/src/walMain.c
+8
-3
未找到文件。
src/dnode/src/dnodeMgmt.c
浏览文件 @
feb49af4
...
@@ -116,7 +116,7 @@ static int32_t dnodeOpenVnodes() {
...
@@ -116,7 +116,7 @@ static int32_t dnodeOpenVnodes() {
free
(
vnodeList
);
free
(
vnodeList
);
dPrint
(
"there are total vnodes:%d,
failed to open:%d"
,
numOfVnodes
,
failed
);
dPrint
(
"there are total vnodes:%d,
openned:%d failed:%d"
,
numOfVnodes
,
numOfVnodes
-
failed
,
failed
);
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
...
src/inc/tsync.h
浏览文件 @
feb49af4
...
@@ -54,8 +54,8 @@ typedef struct {
...
@@ -54,8 +54,8 @@ typedef struct {
int
role
[
TAOS_SYNC_MAX_REPLICA
];
int
role
[
TAOS_SYNC_MAX_REPLICA
];
}
SNodesRole
;
}
SNodesRole
;
// if name is
null
, get the file from index or after, used by master
// if name is
empty(name[0] is zero)
, 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
(name[0] is not zero)
, get the named file at the specified index, used by unsynced node
// it returns the file magic number and size, if file not there, magic shall be 0.
// it returns the file magic number and size, if file not there, magic shall be 0.
typedef
uint32_t
(
*
FGetFileInfo
)(
void
*
ahandle
,
char
*
name
,
uint32_t
*
index
,
int32_t
*
size
);
typedef
uint32_t
(
*
FGetFileInfo
)(
void
*
ahandle
,
char
*
name
,
uint32_t
*
index
,
int32_t
*
size
);
...
@@ -72,6 +72,9 @@ typedef void (*FConfirmForward)(void *ahandle, void *mhandle, int32_t code);
...
@@ -72,6 +72,9 @@ typedef void (*FConfirmForward)(void *ahandle, void *mhandle, int32_t code);
// when role is changed, call this to notify app
// when role is changed, call this to notify app
typedef
void
(
*
FNotifyRole
)(
void
*
ahandle
,
int8_t
role
);
typedef
void
(
*
FNotifyRole
)(
void
*
ahandle
,
int8_t
role
);
// when data file is synced successfully, notity app
typedef
void
(
*
FNotifyFileSynced
)(
void
*
ahandle
);
typedef
struct
{
typedef
struct
{
int32_t
vgId
;
// vgroup ID
int32_t
vgId
;
// vgroup ID
uint64_t
version
;
// initial version
uint64_t
version
;
// initial version
...
@@ -84,7 +87,7 @@ typedef struct {
...
@@ -84,7 +87,7 @@ typedef struct {
FWriteToCache
writeToCache
;
FWriteToCache
writeToCache
;
FConfirmForward
confirmForward
;
FConfirmForward
confirmForward
;
FNotifyRole
notifyRole
;
FNotifyRole
notifyRole
;
FNotifyFileSynced
notifyFileSynced
;
}
SSyncInfo
;
}
SSyncInfo
;
typedef
void
*
tsync_h
;
typedef
void
*
tsync_h
;
...
...
src/rpc/src/rpcTcp.c
浏览文件 @
feb49af4
...
@@ -188,7 +188,7 @@ static void taosAcceptTcpConnection(void *arg) {
...
@@ -188,7 +188,7 @@ static void taosAcceptTcpConnection(void *arg) {
sockFd
=
taosOpenTcpServerSocket
(
pServerObj
->
ip
,
pServerObj
->
port
);
sockFd
=
taosOpenTcpServerSocket
(
pServerObj
->
ip
,
pServerObj
->
port
);
if
(
sockFd
<
0
)
return
;
if
(
sockFd
<
0
)
return
;
tTrace
(
"%s TCP server is ready, ip:
%s
:%hu"
,
pServerObj
->
label
,
pServerObj
->
ip
,
pServerObj
->
port
);
tTrace
(
"%s TCP server is ready, ip:
0x%x
:%hu"
,
pServerObj
->
label
,
pServerObj
->
ip
,
pServerObj
->
port
);
while
(
1
)
{
while
(
1
)
{
socklen_t
addrlen
=
sizeof
(
caddr
);
socklen_t
addrlen
=
sizeof
(
caddr
);
...
...
src/vnode/src/vnodeMain.c
浏览文件 @
feb49af4
...
@@ -46,6 +46,7 @@ static int vnodeWalCallback(void *arg);
...
@@ -46,6 +46,7 @@ static int vnodeWalCallback(void *arg);
static
uint32_t
vnodeGetFileInfo
(
void
*
ahandle
,
char
*
name
,
uint32_t
*
index
,
int32_t
*
size
);
static
uint32_t
vnodeGetFileInfo
(
void
*
ahandle
,
char
*
name
,
uint32_t
*
index
,
int32_t
*
size
);
static
int
vnodeGetWalInfo
(
void
*
ahandle
,
char
*
name
,
uint32_t
*
index
);
static
int
vnodeGetWalInfo
(
void
*
ahandle
,
char
*
name
,
uint32_t
*
index
);
static
void
vnodeNotifyRole
(
void
*
ahandle
,
int8_t
role
);
static
void
vnodeNotifyRole
(
void
*
ahandle
,
int8_t
role
);
static
void
vnodeNotifyFileSynced
(
void
*
ahandle
);
static
pthread_once_t
vnodeModuleInit
=
PTHREAD_ONCE_INIT
;
static
pthread_once_t
vnodeModuleInit
=
PTHREAD_ONCE_INIT
;
...
@@ -234,6 +235,7 @@ int32_t vnodeOpen(int32_t vnode, char *rootDir) {
...
@@ -234,6 +235,7 @@ int32_t vnodeOpen(int32_t vnode, char *rootDir) {
syncInfo
.
writeToCache
=
vnodeWriteToQueue
;
syncInfo
.
writeToCache
=
vnodeWriteToQueue
;
syncInfo
.
confirmForward
=
dnodeSendRpcWriteRsp
;
syncInfo
.
confirmForward
=
dnodeSendRpcWriteRsp
;
syncInfo
.
notifyRole
=
vnodeNotifyRole
;
syncInfo
.
notifyRole
=
vnodeNotifyRole
;
syncInfo
.
notifyFileSynced
=
vnodeNotifyFileSynced
;
pVnode
->
sync
=
syncStart
(
&
syncInfo
);
pVnode
->
sync
=
syncStart
(
&
syncInfo
);
// start continuous query
// start continuous query
...
@@ -405,6 +407,13 @@ static void vnodeNotifyRole(void *ahandle, int8_t role) {
...
@@ -405,6 +407,13 @@ static void vnodeNotifyRole(void *ahandle, int8_t role) {
cqStop
(
pVnode
->
cq
);
cqStop
(
pVnode
->
cq
);
}
}
static
void
vnodeNotifyFileSynced
(
void
*
ahandle
)
{
SVnodeObj
*
pVnode
=
ahandle
;
dTrace
(
"pVnode:%p vgId:%d, data file is synced"
,
pVnode
,
pVnode
->
vgId
);
// clsoe tsdb, then open tsdb
}
static
int32_t
vnodeSaveCfg
(
SMDCreateVnodeMsg
*
pVnodeCfg
)
{
static
int32_t
vnodeSaveCfg
(
SMDCreateVnodeMsg
*
pVnodeCfg
)
{
char
cfgFile
[
TSDB_FILENAME_LEN
+
30
]
=
{
0
};
char
cfgFile
[
TSDB_FILENAME_LEN
+
30
]
=
{
0
};
sprintf
(
cfgFile
,
"%s/vnode%d/config.json"
,
tsVnodeDir
,
pVnodeCfg
->
cfg
.
vgId
);
sprintf
(
cfgFile
,
"%s/vnode%d/config.json"
,
tsVnodeDir
,
pVnodeCfg
->
cfg
.
vgId
);
...
...
src/vnode/src/vnodeWrite.c
浏览文件 @
feb49af4
...
@@ -51,7 +51,7 @@ int32_t vnodeProcessWrite(void *param1, int qtype, void *param2, void *item) {
...
@@ -51,7 +51,7 @@ int32_t vnodeProcessWrite(void *param1, int qtype, void *param2, void *item) {
if
(
vnodeProcessWriteMsgFp
[
pHead
->
msgType
]
==
NULL
)
if
(
vnodeProcessWriteMsgFp
[
pHead
->
msgType
]
==
NULL
)
return
TSDB_CODE_MSG_NOT_PROCESSED
;
return
TSDB_CODE_MSG_NOT_PROCESSED
;
if
(
pVnode
->
status
!=
TAOS_VN_STATUS_READY
)
if
(
pVnode
->
status
!=
TAOS_VN_STATUS_READY
&&
qtype
==
TAOS_QTYPE_RPC
)
return
TSDB_CODE_NOT_ACTIVE_VNODE
;
return
TSDB_CODE_NOT_ACTIVE_VNODE
;
if
(
pHead
->
version
==
0
)
{
// from client
if
(
pHead
->
version
==
0
)
{
// from client
...
...
src/wal/src/walMain.c
浏览文件 @
feb49af4
...
@@ -79,6 +79,8 @@ void *walOpen(const char *path, const SWalCfg *pCfg) {
...
@@ -79,6 +79,8 @@ void *walOpen(const char *path, const SWalCfg *pCfg) {
pthread_mutex_destroy
(
&
pWal
->
mutex
);
pthread_mutex_destroy
(
&
pWal
->
mutex
);
free
(
pWal
);
free
(
pWal
);
pWal
=
NULL
;
pWal
=
NULL
;
}
else
{
wTrace
(
"wal:%s, it is open, level:%d"
,
path
,
pWal
->
level
);
}
}
return
pWal
;
return
pWal
;
...
@@ -177,8 +179,11 @@ void walFsync(void *handle) {
...
@@ -177,8 +179,11 @@ void walFsync(void *handle) {
SWal
*
pWal
=
handle
;
SWal
*
pWal
=
handle
;
if
(
pWal
->
level
==
TAOS_WAL_FSYNC
)
if
(
pWal
->
level
==
TAOS_WAL_FSYNC
&&
pWal
->
fd
>=
0
)
{
fsync
(
pWal
->
fd
);
if
(
fsync
(
pWal
->
fd
)
<
0
)
{
wError
(
"wal:%s, fsync failed(%s)"
,
pWal
->
name
,
strerror
(
errno
));
}
}
}
}
int
walRestore
(
void
*
handle
,
void
*
pVnode
,
int
(
*
writeFp
)(
void
*
,
void
*
,
int
))
{
int
walRestore
(
void
*
handle
,
void
*
pVnode
,
int
(
*
writeFp
)(
void
*
,
void
*
,
int
))
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录