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 configured,but vid still can be found after expiration,after compaction looks normal #4399

Closed
shanlai opened this issue Jul 12, 2022 · 9 comments
Assignees
Labels
affects/v3.1 PR/issue: this bug affects v3.1.x version. priority/low-pri Priority: low type/bug Type: something is unexpected
Milestone

Comments

@shanlai
Copy link

shanlai commented Jul 12, 2022

version:
image

steps

  1. execute ngql:
 CREATE TAG IF NOT EXISTS ttl01 (a timestamp);
 ALTER TAG ttl01 TTL_COL = "a", TTL_DURATION = 60;
 INSERT VERTEX ttl01(a) VALUES "ttl01_01":(now());
 match (v:ttl01) return v limit 1;
 submit job compact
 match (v:ttl01) return v limit 1;

Execution plan of nGQL: match (v:ttl01) return v limit 1;
image

  1. The problems found are as follows:
  • tag: TTL configured,but vid still can be found after expiration,after compaction looks normal,edge same as tag

image

@shanlai shanlai added the type/bug Type: something is unexpected label Jul 12, 2022
@critical27
Copy link
Contributor

Which version is your kernel? 3.1 enterprise version?

@shanlai
Copy link
Author

shanlai commented Jul 12, 2022

3.1.0

@shanlai shanlai changed the title TTL issue TTL configured,but vid still can be found after expiration,after compaction looks normal Jul 12, 2022
@HarrisChu
Copy link
Contributor

for issue 2, refer #3958
we have two times:

  • ::time(NULL);
  • time::WallClock::fastNowInSec();

now() uses the first, and checkDataExpiredForTTL uses the second.

how to reduce:

  1. start storage
  2. change system time, e.g. date -s 04:12:00
  3. execute query insert vertex l1(a) values "101":(now())

@critical27
Copy link
Contributor

for issue 2, refer #3958 we have two times:

  • ::time(NULL);
  • time::WallClock::fastNowInSec();

now() uses the first, and checkDataExpiredForTTL uses the second.

how to reduce:

  1. start storage
  2. change system time, e.g. date -s 04:12:00
  3. execute query insert vertex l1(a) values "101":(now())

👍

@Sophie-Xie Sophie-Xie added this to the v3.3.0 milestone Jul 13, 2022
@Sophie-Xie Sophie-Xie added the need to discuss Solution: issue or PR without a clear conclusion on whether to handle it label Aug 5, 2022
@Sophie-Xie Sophie-Xie removed the need to discuss Solution: issue or PR without a clear conclusion on whether to handle it label Aug 31, 2022
@critical27
Copy link
Contributor

This need to verified after tagless vertex has been removed. It is expected behavior for the first issue

@Sophie-Xie Sophie-Xie added priority/low-pri Priority: low wontfix Solution: this will not be worked on recently labels Sep 26, 2022
@jjsimps
Copy link

jjsimps commented Oct 14, 2022

How come this was marked as won't fix? I have also encountered this issue. It's rather cumbersome to have to filter out invalid/empty results.

For example, when I iterate over the results, the entry shows up (previous deleted by TTL), but the are no tags associated with it. So when I try to access anything I get errors. Even though I filter specifically on a tag existing.

@wey-gu
Copy link
Contributor

wey-gu commented Oct 14, 2022

How come this was marked as won't fix? I have also encountered this issue. It's rather cumbersome to have to filter out invalid/empty results.

For example, when I iterate over the results, the entry shows up (previous deleted by TTL), but the are no tags associated with it. So when I try to access anything I get errors. Even though I filter specifically on a tag existing.

The tagless(bare tag vertex) support will be removed soon, and afterward this issue should be gone(or easier to be handled), right @critical27 @Sophie-Xie ?

@shanlai
Copy link
Author

shanlai commented Nov 22, 2022

After the tagless vertex is removed, if the Vertex has multiple tags, the problem still exists

(root@nebula) [nba_ttl]> CREATE SPACE `ttl_test` (partition_num = 100, replica_factor = 1, charset = utf8, collate = utf8_bin, vid_type = FIXED_STRING(32), atomic_edge = false)
Execution succeeded (time spent 3127/17445 us)

Tue, 22 Nov 2022 10:26:03 CST

(root@nebula) [nba_ttl]> use ttl_test
Execution succeeded (time spent 996/14673 us)

Tue, 22 Nov 2022 10:26:13 CST

(root@nebula) [ttl_test]> CREATE TAG IF NOT EXISTS ttl01 (a timestamp);
Execution succeeded (time spent 2504/16683 us)

Tue, 22 Nov 2022 10:27:27 CST

(root@nebula) [ttl_test]>  ALTER TAG ttl01 TTL_COL = "a", TTL_DURATION = 10;
Execution succeeded (time spent 1647/16351 us)

Tue, 22 Nov 2022 10:27:27 CST

(root@nebula) [ttl_test]> CREATE TAG IF NOT EXISTS ttl02 (a timestamp);
Execution succeeded (time spent 2579/19678 us)

Tue, 22 Nov 2022 10:27:28 CST

(root@nebula) [ttl_test]>  INSERT VERTEX ttl02(a) VALUES "ttl01_01":(now());
Execution succeeded (time spent 984/18110 us)

Tue, 22 Nov 2022 10:27:36 CST

(root@nebula) [ttl_test]> INSERT VERTEX ttl01(a) VALUES "ttl01_01":(now());
Execution succeeded (time spent 1215/29407 us)

Tue, 22 Nov 2022 10:27:38 CST

(root@nebula) [ttl_test]> match (v:ttl01) return v limit 1;
+------------------------------------+
| v                                  |
+------------------------------------+
| ("ttl01_01" :ttl02{a: 1669084056}) |
+------------------------------------+
Got 1 rows (time spent 3435/19022 us)

Tue, 22 Nov 2022 10:27:52 CST

Cause of the problem: ScanVertices not filtering expired data
image

@shanlai shanlai reopened this Nov 22, 2022
@shanlai shanlai added affects/v3.1 PR/issue: this bug affects v3.1.x version. and removed wontfix Solution: this will not be worked on recently labels Nov 22, 2022
@Sophie-Xie Sophie-Xie modified the milestones: v3.3.0, v3.4.0 Nov 22, 2022
@shanlai
Copy link
Author

shanlai commented Nov 22, 2022

fixed in #4578

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects/v3.1 PR/issue: this bug affects v3.1.x version. priority/low-pri Priority: low type/bug Type: something is unexpected
Projects
None yet
Development

No branches or pull requests

6 participants