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] Full compaction does not delete expired data #5518

Closed
shanlai opened this issue Apr 21, 2023 · 9 comments · Fixed by #5622
Closed

[TTL] Full compaction does not delete expired data #5518

shanlai opened this issue Apr 21, 2023 · 9 comments · Fixed by #5622
Assignees
Labels
affects/master PR/issue: this bug affects master version. process/fixed Process of bug severity/major Severity of bug type/bug Type: something is unexpected
Milestone

Comments

@shanlai
Copy link

shanlai commented Apr 21, 2023

Please check the FAQ documentation before raising an issue

Describe the bug (required)
as title

Your Environments (required)
3.5.0 rc 40c4bc7

How To Reproduce(required)

  1. create schema and insert test data
CREATE SPACE `nba1` (partition_num = 10, replica_factor = 1, charset = utf8, collate = utf8_bin, vid_type = FIXED_STRING(32));

USE nba1;
CREATE TAG player(name string, age int, update_time timestamp DEFAULT now()) TTL_DURATION= 3, TTL_COL = "update_time";

INSERT VERTEX player(name, age) VALUES "player100":("Tim Duncan", 42);

  1. After the data is expired, submit job:compact and stats in order, then use show stats to check, and find that the statistics contains expired data
(root@nebula) [nba1]> match (v) return v;
+---+
| v |
+---+
+---+
Empty set (time spent 844µs/14.927584ms)

Fri, 21 Apr 2023 12:34:26 CST

(root@nebula) [nba1]> submit job compact
+------------+
| New Job Id |
+------------+
| 730        |
+------------+
Got 1 rows (time spent 1.175ms/23.192875ms)

Fri, 21 Apr 2023 12:34:33 CST

(root@nebula) [nba1]> submit job stats
+------------+
| New Job Id |
+------------+
| 731        |
+------------+
Got 1 rows (time spent 930µs/17.026792ms)

Fri, 21 Apr 2023 12:34:38 CST

(root@nebula) [nba1]> show stats
+---------+------------+-------+
| Type    | Name       | Count |
+---------+------------+-------+
| "Tag"   | "player"   | 1     |
| "Space" | "vertices" | 1     |
| "Space" | "edges"    | 0     |
+---------+------------+-------+
Got 3 rows (time spent 469µs/14.285ms)

Fri, 21 Apr 2023 12:34:42 CST

Expected behavior
Full compaction should to delete expired data

@shanlai shanlai added type/bug Type: something is unexpected severity/major Severity of bug affects/master PR/issue: this bug affects master version. labels Apr 21, 2023
@shanlai shanlai added this to the v3.5.0 milestone Apr 21, 2023
@luyade
Copy link
Contributor

luyade commented Apr 21, 2023

set min_level_for_custom_filter to be 0 will be fine

@HarrisChu
Copy link
Contributor

#5447

@HarrisChu
Copy link
Contributor

root cause:

if the tag is TTL expired, we would always calculate the stats unless compaction.
maybe we could fix it in StatsTask

@shanlai
Copy link
Author

shanlai commented Apr 21, 2023

set min_level_for_custom_filter to be 0 will be fine

test passed after setting min_level_for_custom_filter to 0, It is recommended to add a description of this parameter in the documentation
image

@Sophie-Xie
Copy link
Contributor

@luyade @critical27 discussed it with @MuYiYong offline, can we keep the same behavior as in the past, default value is 0?

@critical27
Copy link
Contributor

critical27 commented Apr 23, 2023

root cause:

if the tag is TTL expired, we would always calculate the stats unless compaction. maybe we could fix it in StatsTask

Agree, the bug has no relation with the new gflag min_level_for_custom_filter.
Change it to 0 is a bypass, you can decide whether to change it or not. @MuYiYong

@Sophie-Xie
Copy link
Contributor

root cause:
if the tag is TTL expired, we would always calculate the stats unless compaction. maybe we could fix it in StatsTask

Agree, the bug has no relation with the new gflag min_level_for_custom_filter. Change it to 0 is a bypass, you can decide whether to change it or not. @MuYiYong

discuss offline with @MuYiYong : set min_level_for_custom_filter to 0 by default.

@Sophie-Xie
Copy link
Contributor

@luyade can you fix it? Thanks~~

@luyade
Copy link
Contributor

luyade commented Jul 6, 2023

@luyade can you fix it? Thanks~~

No pro. Already added the PR.

@github-actions github-actions bot added the process/fixed Process of bug label Jul 6, 2023
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. process/fixed Process of bug severity/major Severity of bug type/bug Type: something is unexpected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants