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

[TTL] If there is no compaction, the modification to ttl may not take effect #5134

Closed
cangfengzhs opened this issue Dec 28, 2022 · 10 comments
Closed
Assignees
Labels
affects/master PR/issue: this bug affects master version. doc affected PR: improvements or additions to documentation process/done Process of bug process/fixed Process of bug severity/minor Severity of bug type/bug Type: something is unexpected wontfix Solution: this will not be worked on recently
Milestone

Comments

@cangfengzhs
Copy link
Contributor

cangfengzhs commented Dec 28, 2022

Please check the FAQ documentation before raising an issue

Describe the bug (required)

create tag ttl_tag2(age int, ttl timestamp) ttl_duration=600, ttl_col="ttl";
insert vertex ttl_tag2(age,ttl) VALUES "1":(10,now());
match (v:ttl_tag2) return v limit 10;  //  visible
alter tag ttl_tag2 ttl_duration=5;
match (v:ttl_tag2) return v limit 10; // not visible
alter tag ttl_tag2 ttl_duration=600;
match (v:ttl_tag2) return v limit 10; // visible

Your Environments (required)

  • OS: uname -a
  • Compiler: g++ --version or clang++ --version
  • CPU: lscpu
  • Commit id (e.g. a3ffc7d8)

How To Reproduce(required)

Steps to reproduce the behavior:

  1. Step 1
  2. Step 2
  3. Step 3

Expected behavior

Additional context

@cangfengzhs cangfengzhs added the type/bug Type: something is unexpected label Dec 28, 2022
@github-actions github-actions bot added affects/none PR/issue: this bug affects none version. severity/none Severity of bug labels Dec 28, 2022
@Sophie-Xie Sophie-Xie added this to the v3.4.0 milestone Dec 28, 2022
@HarrisChu
Copy link
Contributor

is it by design?

@shanlai shanlai added severity/minor Severity of bug affects/master PR/issue: this bug affects master version. and removed severity/none Severity of bug affects/none PR/issue: this bug affects none version. labels Dec 28, 2022
@cangfengzhs
Copy link
Contributor Author

In terms of design, it is right. But functionally, or logically, it is wrong.

@HarrisChu
Copy link
Contributor

agreed..

if the data is not deleted by compaction, we always compare with the latest ttl duration.
if there're 10 tags, and 5 tags have been deleted, and the other 5 have not.
it may make user confused.

@HarrisChu HarrisChu added the wontfix Solution: this will not be worked on recently label Jan 3, 2023
@HarrisChu
Copy link
Contributor

marked as known issue

@github-actions github-actions bot added the process/fixed Process of bug label Jan 3, 2023
@shanlai shanlai added doc affected PR: improvements or additions to documentation process/done Process of bug labels Jan 6, 2023
@github-actions github-actions bot removed the process/fixed Process of bug label Jan 6, 2023
@shanlai
Copy link

shanlai commented Jan 6, 2023

@abby-cyber please update doc

@whitewum
Copy link
Contributor

whitewum commented Jan 9, 2023

@abby-cyber please update doc

I think this is a data error, from the view of a user.

I do not agree to add to doc just as a warning. What is by design? Who designed this data error operation?

@MuYiYong @Sophie-Xie

@whitewum whitewum reopened this Jan 9, 2023
@critical27
Copy link
Contributor

It is a data error indeed, but it can't be addressed totally. There is a workaround: forbid alter ttl duration if already has one.

@whitewum
Copy link
Contributor

whitewum commented Jan 9, 2023

What if this TTL tag is dropped and re-created?

@critical27
Copy link
Contributor

IIRC, drop TTL is achieved by alter as well. I really don't remember this behavior precisely.

@HarrisChu
Copy link
Contributor

HarrisChu commented Jan 10, 2023

update more details in v3.4 rc

  1. we could edit the ttl duration in one tag. (also could edit the ttl col)
  2. we could not drop and add the same property.
(root@nebula) [(none)]> create space harris(vid_type=fixed_string(10))
Execution succeeded (time spent 9721/23528 us)

Tue, 10 Jan 2023 09:13:34 CST

(root@nebula) [(none)]> use harris
Execution succeeded (time spent 1195/15207 us)

Tue, 10 Jan 2023 09:13:38 CST

(root@nebula) [harris]> create tag ttl_tag2(age int, ttl timestamp) ttl_duration=600, ttl_col="ttl";
Execution succeeded (time spent 5350/18644 us)

Tue, 10 Jan 2023 09:13:40 CST

(root@nebula) [harris]> insert vertex ttl_tag2(age,ttl) VALUES "1":(10,now());
Execution succeeded (time spent 3422/20693 us)

Tue, 10 Jan 2023 09:13:44 CST

(root@nebula) [harris]> match (v:ttl_tag2) return v limit 10;
+-------------------------------------------+
| v                                         |
+-------------------------------------------+
| ("1" :ttl_tag2{age: 10, ttl: 1673313225}) |
+-------------------------------------------+
Got 1 rows (time spent 10824/24590 us)

Tue, 10 Jan 2023 09:13:49 CST

(root@nebula) [harris]> alter tag ttl_tag2 ttl_duration=5;
Execution succeeded (time spent 3936/19855 us)

Tue, 10 Jan 2023 09:13:52 CST

(root@nebula) [harris]> match (v:ttl_tag2) return v limit 10;
+---+
| v |
+---+
+---+
Empty set (time spent 4044/20797 us)

Tue, 10 Jan 2023 09:13:56 CST

(root@nebula) [harris]> alter tag ttl_tag2 ttl_duration=600;
Execution succeeded (time spent 3182/20368 us)

Tue, 10 Jan 2023 09:14:00 CST

(root@nebula) [harris]> match (v:ttl_tag2) return v limit 10;
+-------------------------------------------+
| v                                         |
+-------------------------------------------+
| ("1" :ttl_tag2{age: 10, ttl: 1673313225}) |
+-------------------------------------------+
Got 1 rows (time spent 3734/17573 us)

Tue, 10 Jan 2023 09:14:04 CST

(root@nebula) [harris]> show hosts
+-----------------+-------+----------+--------------+-------------------------------------------+--------------------------------------------+-------------+
| Host            | Port  | Status   | Leader count | Leader distribution                       | Partition distribution                     | Version     |
+-----------------+-------+----------+--------------+-------------------------------------------+--------------------------------------------+-------------+
| "192.168.8.152" | 10030 | "ONLINE" | 77           | "harris:34, nba:34, sf0_1:5, 王者荣耀:4"  | "harris:34, nba:34, sf0_1:24, 王者荣耀:12" | "3.4.0-ent" |
| "192.168.8.152" | 10035 | "ONLINE" | 76           | "harris:33, nba:33, sf0_1:6, 王者荣耀:4"  | "harris:33, nba:33, sf0_1:24, 王者荣耀:12" | "3.4.0-ent" |
| "192.168.8.152" | 10040 | "ONLINE" | 83           | "harris:33, nba:33, sf0_1:13, 王者荣耀:4" | "harris:33, nba:33, sf0_1:24, 王者荣耀:12" | "3.4.0-ent" |
+-----------------+-------+----------+--------------+-------------------------------------------+--------------------------------------------+-------------+
Got 3 rows (time spent 2281/21594 us)

Tue, 10 Jan 2023 09:14:06 CST

(root@nebula) [harris]> alter tag ttl_tag2 drop (ttl)
Execution succeeded (time spent 3059/15864 us)

Tue, 10 Jan 2023 09:16:28 CST

(root@nebula) [harris]> alter tag ttl_tag2 add (ttl timestamp)
[ERROR (-1005)]: Existed!

Tue, 10 Jan 2023 09:16:38 CST

(root@nebula) [harris]>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects/master PR/issue: this bug affects master version. doc affected PR: improvements or additions to documentation process/done Process of bug process/fixed Process of bug severity/minor Severity of bug type/bug Type: something is unexpected wontfix Solution: this will not be worked on recently
Projects
None yet
Development

No branches or pull requests

8 participants