Skip to content

Feat/updateMultiTag #28925

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

Merged
merged 25 commits into from
Nov 28, 2024
Merged

Feat/updateMultiTag #28925

merged 25 commits into from
Nov 28, 2024

Conversation

yihaoDeng
Copy link
Contributor

@yihaoDeng yihaoDeng commented Nov 25, 2024

Pull Request Checklist

  • Is the user manual updated?
  • Are the test cases passed and automated?
  • Is there no significant decrease in test coverage?

goto end;
}
cJSON* colValue = cJSON_CreateString(buf);
RAW_NULL_CHECK(colValue);
Copy link
Contributor

@kailixu kailixu Nov 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. 此处返回,buf 会泄露。 2. 另外,buf 在多个 tag 之间是否可以共用。
  2. 原来修改单个 tagVal 的逻辑: TSDB_ALTER_TABLE_UPDATE_TAG_VAL,有类似的泄漏风险问题。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. 此处返回,buf 会泄露。 2. 另外,buf 在多个 tag 之间是否可以共用。
  2. 原来修改单个 tagVal 的逻辑: TSDB_ALTER_TABLE_UPDATE_TAG_VAL,有类似的泄漏风险问题。
  1. 确实有个这个问题,要改的话,整个函数都需要改,暂时先不改
  2. buf 共用的问题,这个之后可以优化下。

}
cJSON* colValue = cJSON_CreateString(buf);
RAW_NULL_CHECK(colValue);
RAW_FALSE_CHECK(cJSON_AddItemToObject(member, "colValue", colValue));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上
整个函数都没有处理这个异常跳出,导致内存泄露的问题,先不改了,主要是现在时间比较紧,我再其他PR中处理这个

}

if (NULL == ctbEntry.ctbEntry.pTags) {
metaError("meta/table: null tags, update tag val failed.");
Copy link
Contributor

@kailixu kailixu Nov 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. metaWLock 需要释放
  2. 另外,如果 ctbEntry.ctbEntry.pTags 为NULL,是不是就跳转至 _err了,这个分支根本就不存在。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. metaWLock 需要释放
  2. 另外,如果 ctbEntry.ctbEntry.pTags 为NULL,是不是就跳转至 _err了,这个分支根本就不存在。

这是个无效的逻辑

Copy link
Contributor

@kailixu kailixu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

有个跳转逻辑,metaWLock 需要释放。另外,感觉那个跳转逻辑,永远不会进去,是否有必要?

sql insert into $tb values(now, 1)
sql_error alter table $mt set tag tgcol1 = 1,tagcol2 = 2, tag3 = 4 # set tag value on supertable
sql_error alter table $ntable set tag f = 10 # set normal table value
sql_error alter table $tbj set tag tagCol1=1,tagCol1 = 2 # dumplicate tag name
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dumplicate: typo -> duplicate

sql_error alter table $mt set tag tgcol1 = 1,tagcol2 = 2, tag3 = 4 # set tag value on supertable
sql_error alter table $ntable set tag f = 10 # set normal table value
sql_error alter table $tbj set tag tagCol1=1,tagCol1 = 2 # dumplicate tag name
sql_error alter table $tbj set tag tagCol1=1,tagCol1 = 2 # not exist tag
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这两个列都是存在的,只是 duplicate。是否按注释说的,要增加一个列不存在,以及 列 为 NULL 值的 用例。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这两个列都是存在的,只是 duplicate。是否按注释说的,要增加一个列不存在,以及 列 为 NULL 值的 用例。

这个在整个脚本的最后有,有动态删除tag之后,然后设值的,不过这里可以修改下,放在一块

}
if (c != 0) {
tdbTbcClose(pUidIdxc);
metaError("meta/table: invalide c: %" PRId32 " update tb tag val failed.", c);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: invalid

if (c != 0) {
tdbTbcClose(pUidIdxc);
tdbTbcClose(pTbDbc);
metaError("meta/table: invalide c: %" PRId32 " update tb tag val failed.", c);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: invalid

@yihaoDeng
Copy link
Contributor Author

有个跳转逻辑,metaWLock 需要释放。另外,感觉那个跳转逻辑,永远不会进去,是否有必要?
这个分支进不去,所以没有泄露或者死锁的问题。 我在其他分支调整下,删除这个分支

@guanshengliang guanshengliang merged commit ab604c1 into main Nov 28, 2024
1 check passed
@minhuinie minhuinie deleted the feat/updateMultiTag branch March 24, 2025 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants