Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
codyshao
TDengine
提交
534c67b6
T
TDengine
项目概览
codyshao
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
2
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
534c67b6
编写于
8月 04, 2019
作者:
S
slguan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
data loss due to too new data
上级
b96f7962
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
16 addition
and
27 deletion
+16
-27
src/system/inc/vnode.h
src/system/inc/vnode.h
+0
-14
src/system/src/dnodeMgmt.c
src/system/src/dnodeMgmt.c
+2
-2
src/system/src/dnodeSystem.c
src/system/src/dnodeSystem.c
+2
-2
src/system/src/vnodeFile.c
src/system/src/vnodeFile.c
+5
-5
src/system/src/vnodeImport.c
src/system/src/vnodeImport.c
+7
-4
未找到文件。
src/system/inc/vnode.h
浏览文件 @
534c67b6
...
...
@@ -419,10 +419,6 @@ void vnodeCommitOver(SVnodeObj *pVnode);
TSKEY
vnodeGetFirstKey
(
int
vnode
);
int
vnodeSyncRetrieveCache
(
int
vnode
,
int
fd
);
int
vnodeSyncRestoreCache
(
int
vnode
,
int
fd
);
pthread_t
vnodeCreateCommitThread
(
SVnodeObj
*
pVnode
);
void
vnodeCancelCommit
(
SVnodeObj
*
pVnode
);
...
...
@@ -448,10 +444,6 @@ void *vnodeCommitToFile(void *param);
void
*
vnodeCommitMultiToFile
(
SVnodeObj
*
pVnode
,
int
ssid
,
int
esid
);
int
vnodeSyncRetrieveFile
(
int
vnode
,
int
fd
,
uint32_t
fileId
,
uint64_t
*
fmagic
);
int
vnodeSyncRestoreFile
(
int
vnode
,
int
sfd
);
int
vnodeWriteBlockToFile
(
SMeterObj
*
pObj
,
SCompBlock
*
pBlock
,
SData
*
data
[],
SData
*
cdata
[],
int
pointsRead
);
int
vnodeSearchPointInFile
(
SMeterObj
*
pObj
,
SQuery
*
pQuery
);
...
...
@@ -477,14 +469,8 @@ void *vnodeGetMeterPeerConnection(SMeterObj *pObj, int index);
int
vnodeForwardToPeer
(
SMeterObj
*
pObj
,
char
*
msg
,
int
msgLen
,
char
action
,
int
sversion
);
void
vnodeCloseAllSyncFds
(
int
vnode
);
void
vnodeConfigVPeers
(
int
vnode
,
int
numOfPeers
,
SVPeerDesc
peerDesc
[]);
void
vnodeStartSyncProcess
(
SVnodeObj
*
pVnode
);
void
vnodeCancelSync
(
int
vnode
);
void
vnodeListPeerStatus
(
char
*
buffer
);
void
vnodeCheckOwnStatus
(
SVnodeObj
*
pVnode
);
...
...
src/system/src/dnodeMgmt.c
浏览文件 @
534c67b6
...
...
@@ -113,7 +113,7 @@ int vnodeProcessCreateMeterRequest(char *pMsg) {
pVnode
=
vnodeList
+
vid
;
if
(
pVnode
->
cfg
.
maxSessions
<=
0
)
{
dError
(
"vid:%d, not activated"
,
vid
);
code
=
TSDB_CODE_
INVALID_SESSION_ID
;
code
=
TSDB_CODE_
NOT_ACTIVE_SESSION
;
goto
_over
;
}
...
...
@@ -215,7 +215,7 @@ int vnodeProcessCreateMeterMsg(char *pMsg) {
if
(
pVnode
->
pCachePool
==
NULL
)
{
dError
(
"vid:%d is not activated yet"
,
pCreate
->
vnode
);
vnodeSendVpeerCfgMsg
(
pCreate
->
vnode
);
code
=
TSDB_CODE_
INVALID_SESSION_ID
;
code
=
TSDB_CODE_
NOT_ACTIVE_SESSION
;
goto
_create_over
;
}
...
...
src/system/src/dnodeSystem.c
浏览文件 @
534c67b6
...
...
@@ -44,7 +44,7 @@ void dnodeInitModules() {
tsModule
[
TSDB_MOD_HTTP
].
cleanUpFp
=
httpCleanUpSystem
;
tsModule
[
TSDB_MOD_HTTP
].
startFp
=
httpStartSystem
;
tsModule
[
TSDB_MOD_HTTP
].
stopFp
=
httpStopSystem
;
tsModule
[
TSDB_MOD_HTTP
].
num
=
tsEnableHttpModule
?
-
1
:
0
;
tsModule
[
TSDB_MOD_HTTP
].
num
=
(
tsEnableHttpModule
==
1
)
?
-
1
:
0
;
tsModule
[
TSDB_MOD_HTTP
].
curNum
=
0
;
tsModule
[
TSDB_MOD_HTTP
].
equalVnodeNum
=
0
;
...
...
@@ -53,7 +53,7 @@ void dnodeInitModules() {
tsModule
[
TSDB_MOD_MONITOR
].
cleanUpFp
=
monitorCleanUpSystem
;
tsModule
[
TSDB_MOD_MONITOR
].
startFp
=
monitorStartSystem
;
tsModule
[
TSDB_MOD_MONITOR
].
stopFp
=
monitorStopSystem
;
tsModule
[
TSDB_MOD_MONITOR
].
num
=
tsEnableMonitorModule
?
-
1
:
0
;
tsModule
[
TSDB_MOD_MONITOR
].
num
=
(
tsEnableMonitorModule
==
1
)
?
-
1
:
0
;
tsModule
[
TSDB_MOD_MONITOR
].
curNum
=
0
;
tsModule
[
TSDB_MOD_MONITOR
].
equalVnodeNum
=
0
;
}
...
...
src/system/src/vnodeFile.c
浏览文件 @
534c67b6
...
...
@@ -408,7 +408,6 @@ void vnodeCloseCommitFiles(SVnodeObj *pVnode) {
char
dpath
[
TSDB_FILENAME_LEN
]
=
"
\0
"
;
int
fileId
;
int
ret
;
int
file_removed
=
0
;
close
(
pVnode
->
nfd
);
pVnode
->
nfd
=
0
;
...
...
@@ -449,14 +448,15 @@ void vnodeCloseCommitFiles(SVnodeObj *pVnode) {
dTrace
(
"vid:%d, %s and %s is saved"
,
pVnode
->
vnode
,
pVnode
->
cfn
,
pVnode
->
lfn
);
if
(
pVnode
->
numOfFiles
>
pVnode
->
maxFiles
)
{
fileId
=
pVnode
->
fileId
-
pVnode
->
numOfFiles
+
1
;
// Retention policy here
fileId
=
pVnode
->
fileId
-
pVnode
->
numOfFiles
+
1
;
int
cfile
=
taosGetTimestamp
(
pVnode
->
cfg
.
precision
)
/
pVnode
->
cfg
.
daysPerFile
/
tsMsPerDay
[
pVnode
->
cfg
.
precision
];
while
(
fileId
<=
cfile
-
pVnode
->
maxFiles
)
{
vnodeRemoveFile
(
pVnode
->
vnode
,
fileId
);
pVnode
->
numOfFiles
--
;
file
_removed
=
1
;
file
Id
++
;
}
if
(
!
file_removed
)
vnodeUpdateFileMagic
(
pVnode
->
vnode
,
pVnode
->
commitFileId
);
vnodeSaveAllMeterObjToFile
(
pVnode
->
vnode
);
return
;
...
...
src/system/src/vnodeImport.c
浏览文件 @
534c67b6
...
...
@@ -870,10 +870,13 @@ int vnodeImportPoints(SMeterObj *pObj, char *cont, int contLen, char source, voi
}
payload
=
pSubmit
->
payLoad
;
if
(
pVnode
->
lastKeyOnFile
>
pVnode
->
cfg
.
daysToKeep
*
tsMsPerDay
[
pVnode
->
cfg
.
precision
]
+
*
((
TSKEY
*
)(
payload
)))
{
dError
(
"vid:%d sid:%d id:%s, vnode lastKeyOnFile:%lld, data is too old to import, key:%lld"
,
pObj
->
vnode
,
pObj
->
sid
,
pObj
->
meterId
,
pVnode
->
lastKeyOnFile
,
*
(
TSKEY
*
)(
payload
));
return
TSDB_CODE_OTHERS
;
int
firstId
=
(
*
(
TSKEY
*
)
payload
)
/
pVnode
->
cfg
.
daysPerFile
/
tsMsPerDay
[
pVnode
->
cfg
.
precision
];
int
lastId
=
(
*
(
TSKEY
*
)(
payload
+
pObj
->
bytesPerPoint
*
(
rows
-
1
)))
/
pVnode
->
cfg
.
daysPerFile
/
tsMsPerDay
[
pVnode
->
cfg
.
precision
];
int
cfile
=
taosGetTimestamp
(
pVnode
->
cfg
.
precision
)
/
pVnode
->
cfg
.
daysPerFile
/
tsMsPerDay
[
pVnode
->
cfg
.
precision
];
if
((
firstId
<=
cfile
-
pVnode
->
maxFiles
)
||
(
firstId
>
cfile
+
1
)
||
(
lastId
<=
cfile
-
pVnode
->
maxFiles
)
||
(
lastId
>
cfile
+
1
))
{
dError
(
"vid:%d sid:%d id:%s, invalid timestamp to import, firstKey: %ld lastKey: %ld"
,
pObj
->
vnode
,
pObj
->
sid
,
pObj
->
meterId
,
*
(
TSKEY
*
)(
payload
),
*
(
TSKEY
*
)(
payload
+
pObj
->
bytesPerPoint
*
(
rows
-
1
)));
return
TSDB_CODE_TIMESTAMP_OUT_OF_RANGE
;
}
if
(
pVnode
->
cfg
.
commitLog
&&
source
!=
TSDB_DATA_SOURCE_LOG
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录