Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge: from main to 3.0 #28695

Merged
merged 42 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
e3beccb
enh: add more log for last cache retrieve
LiShunGang Oct 24, 2024
8984231
fix vnode cannot restart while wal level =0
xiao-77 Nov 4, 2024
aa8bc83
update fqdn cache
yihaoDeng Nov 6, 2024
0a9d1d8
update fqdn cache
yihaoDeng Nov 6, 2024
268576b
fix double free when meet mem leak
yihaoDeng Nov 6, 2024
4b49433
fix(stream): fix the underlying scan operations for stream, when tryi…
hjxilinx Nov 6, 2024
3aca3c6
Merge pull request #28662 from taosdata/fix/TD-32829
guanshengliang Nov 7, 2024
b0902e8
Merge pull request #28659 from taosdata/fix/main/32800
guanshengliang Nov 7, 2024
5cc02a7
test: add smoke test scripts
tomchon Nov 7, 2024
81d321a
test:modify somketest dir name
tomchon Nov 7, 2024
3034c22
Merge pull request #28664 from taosdata/fix/liaohj
guanshengliang Nov 7, 2024
bc095b5
Update 02-database.md
boxiaobj Nov 7, 2024
9473668
Update test_server.py
tomchon Nov 7, 2024
f2cea6a
Merge pull request #28684 from taosdata/boxiaobj-patch-1
guanshengliang Nov 7, 2024
fa62b95
test: add smoke test scripts
tomchon Nov 7, 2024
446122a
test: add smoke test scripts
tomchon Nov 7, 2024
234846b
test: add smoke test scripts
tomchon Nov 7, 2024
daedcc5
refactor: return the error code and do some refactor.
hjxilinx Nov 7, 2024
a8f7f15
refactor: do some internal refacrtor.
hjxilinx Nov 7, 2024
7388116
fix: install for taosanode
guanshengliang Nov 7, 2024
3e600b6
Merge pull request #28689 from taosdata/doc/contrib
guanshengliang Nov 7, 2024
6a601e0
doc(stream):recover stream
54liuyao Nov 7, 2024
56be3e7
doc(stream):recover stream
54liuyao Nov 7, 2024
7b6824d
doc(stream):recover stream
54liuyao Nov 7, 2024
8757021
doc(stream):recover stream
54liuyao Nov 7, 2024
952345c
Merge branch '3.0' into merge/3.0tomain
guanshengliang Nov 7, 2024
49c606e
Merge pull request #28690 from taosdata/doc/ly_stream
guanshengliang Nov 7, 2024
334f822
doc: minor changes
guanshengliang Nov 7, 2024
c1f1c35
Merge pull request #28692 from taosdata/doc/ly_stream
guanshengliang Nov 7, 2024
9a8a91b
doc(stream):recover stream
54liuyao Nov 7, 2024
044645f
doc(stream):recover stream
54liuyao Nov 7, 2024
ce0bd07
doc(stream):recover stream
54liuyao Nov 7, 2024
cb9d539
Merge branch 'main' of https://github.com/taosdata/TDengine
54liuyao Nov 7, 2024
1f7c9c9
doc(stream):recover stream
54liuyao Nov 7, 2024
ba27958
doc(stream):recover stream
54liuyao Nov 7, 2024
032e2f4
Merge pull request #28678 from taosdata/test/main/chr/smoketest
feici02 Nov 7, 2024
774ad21
doc(stream):recover stream
54liuyao Nov 7, 2024
e64ad3a
doc(stream):recover stream
54liuyao Nov 7, 2024
39e532f
Merge pull request #28693 from taosdata/doc/ly_stream_1
guanshengliang Nov 7, 2024
f9e7b52
Merge pull request #28686 from taosdata/fix/liaohj
guanshengliang Nov 7, 2024
6c487c3
Merge pull request #28472 from taosdata/enh/TD-31867-main
hzcheng Nov 7, 2024
b0b1a23
Merge pull request #28691 from taosdata/merge/3.0tomain
guanshengliang Nov 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,4 @@ version.h
geos_c.h
source/libs/parser/src/sql.c
include/common/ttokenauto.h

!packaging/smokeTest/pytest_require.txt
33 changes: 32 additions & 1 deletion docs/zh/06-advanced/03-stream.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,4 +228,35 @@ PAUSE STREAM [IF EXISTS] stream_name;
RESUME STREAM [IF EXISTS] [IGNORE UNTREATED] stream_name;
```

没有指定 IF EXISTS,如果该 stream 不存在,则报错。如果存在,则恢复流计算。指定了 IF EXISTS,如果 stream 不存在,则返回成功。如果存在,则恢复流计算。如果指定 IGNORE UNTREATED,则恢复流计算时,忽略流计算暂停期间写入的数据。
没有指定 IF EXISTS,如果该 stream 不存在,则报错。如果存在,则恢复流计算。指定了 IF EXISTS,如果 stream 不存在,则返回成功。如果存在,则恢复流计算。如果指定 IGNORE UNTREATED,则恢复流计算时,忽略流计算暂停期间写入的数据。

### 流计算升级故障恢复

升级 TDengine 后,如果流计算不兼容,需要删除流计算,然后重新创建流计算。步骤如下:

1.修改 taos.cfg,添加 disableStream 1

2.重启 taosd。如果启动失败,修改 stream 目录的名称,避免 taosd 启动的时候尝试加载 stream 目录下的流计算数据信息。不使用删除操作避免误操作导致的风险。需要修改的文件夹:$dataDir/vnode/vnode*/tq/stream,$dataDir 指 TDengine 存储数据的目录,在 $dataDir/vnode/ 目录下会有多个类似 vnode1 、vnode2...vnode* 的目录,全部需要修改里面的 tq/stream 目录的名字,改为 tq/stream.bk

3.启动 taos

```sql
drop stream xxxx; ---- xxx 指stream name
flush database stream_source_db; ---- 流计算读取数据的超级表所在的 database
flush database stream_dest_db; ---- 流计算写入数据的超级表所在的 database
```

举例:

```sql
create stream streams1 into test1.streamst as select _wstart, count(a) c1 from test.st interval(1s) ;
drop database streams1;
flush database test;
flush database test1;
```

4.关闭 taosd

5.修改 taos.cfg,去掉 disableStream 1,或将 disableStream 改为 0

6.启动 taosd
1 change: 1 addition & 0 deletions docs/zh/14-reference/03-taos-sql/02-database.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ alter_database_option: {
| KEEP value
| WAL_RETENTION_PERIOD value
| WAL_RETENTION_SIZE value
| MINROWS value
}
```

Expand Down
10 changes: 5 additions & 5 deletions include/common/tanal.h → include/common/tanalytics.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ typedef struct {
int32_t anode;
int32_t urlLen;
char *url;
} SAnalUrl;
} SAnalyticsUrl;

typedef enum {
ANAL_BUF_TYPE_JSON = 0,
Expand All @@ -53,18 +53,18 @@ typedef struct {
TdFilePtr filePtr;
char fileName[TSDB_FILENAME_LEN + 10];
int64_t numOfRows;
} SAnalColBuf;
} SAnalyticsColBuf;

typedef struct {
EAnalBufType bufType;
TdFilePtr filePtr;
char fileName[TSDB_FILENAME_LEN];
int32_t numOfCols;
SAnalColBuf *pCols;
SAnalyticsColBuf *pCols;
} SAnalBuf;

int32_t taosAnalInit();
void taosAnalCleanup();
int32_t taosAnalyticsInit();
void taosAnalyticsCleanup();
SJson *taosAnalSendReqRetJson(const char *url, EAnalHttpType type, SAnalBuf *pBuf);

int32_t taosAnalGetAlgoUrl(const char *algoName, EAnalAlgoType type, char *url, int32_t urlLen);
Expand Down
59 changes: 59 additions & 0 deletions packaging/delete_ref_lock.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import subprocess
import re

# 执行 git fetch 命令并捕获输出
def git_fetch():
result = subprocess.run(['git', 'fetch'], capture_output=True, text=True)
return result

# 解析分支名称
def parse_branch_name_type1(error_output):
# 使用正则表达式匹配 'is at' 前的分支名称
match = re.search(r"error: cannot lock ref '(refs/remotes/origin/[^']+)': is at", error_output)
if match:
return match.group(1)
return None

# 解析第二种错误中的分支名称
def parse_branch_name_type2(error_output):
# 使用正则表达式匹配 'exists' 前的第一个引号内的分支名称
match = re.search(r"'(refs/remotes/origin/[^']+)' exists;", error_output)
if match:
return match.group(1)
return None

# 执行 git update-ref -d 命令
def git_update_ref(branch_name):
if branch_name:
subprocess.run(['git', 'update-ref', '-d', f'{branch_name}'], check=True)

# 解析错误类型并执行相应的修复操作
def handle_error(error_output):
# 错误类型1:本地引用的提交ID与远程不一致
if "is at" in error_output and "but expected" in error_output:
branch_name = parse_branch_name_type1(error_output)
if branch_name:
print(f"Detected error type 1, attempting to delete ref for branch: {branch_name}")
git_update_ref(branch_name)
else:
print("Error parsing branch name for type 1.")
# 错误类型2:尝试创建新的远程引用时,本地已经存在同名的引用
elif "exists; cannot create" in error_output:
branch_name = parse_branch_name_type2(error_output)
if branch_name:
print(f"Detected error type 2, attempting to delete ref for branch: {branch_name}")
git_update_ref(branch_name)
else:
print("Error parsing branch name for type 2.")

# 主函数
def main():
fetch_result = git_fetch()
if fetch_result.returncode != 0: # 如果 git fetch 命令失败
error_output = fetch_result.stderr
handle_error(error_output)
else:
print("Git fetch successful.")

if __name__ == "__main__":
main()
Loading
Loading