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

Using multi insert on an indexed tag will cause incorrect lookup results #3193

Closed
cangfengzhs opened this issue Oct 23, 2021 · 2 comments · Fixed by #3627
Closed

Using multi insert on an indexed tag will cause incorrect lookup results #3193

cangfengzhs opened this issue Oct 23, 2021 · 2 comments · Fixed by #3627
Assignees
Labels
type/bug Type: something is unexpected
Milestone

Comments

@cangfengzhs
Copy link
Contributor

cangfengzhs commented Oct 23, 2021

Please check the FAQ documentation before raising an issue

Please check the FAQ documentation and old issues before raising an issue in case someone has asked the same question that you are asking.

Describe the bug (must be provided)

(root@nebula) [test]> create tag t2(num1 int,num2 int);
Execution succeeded (time spent 1617/1979 us)

Sat, 23 Oct 2021 22:29:41 CST

(root@nebula) [test]> create tag index index_t2_num1 on t2(num1);
Execution succeeded (time spent 1562/1893 us)

Sat, 23 Oct 2021 22:30:27 CST

(root@nebula) [test]> insert vertex t2(num1,num2) VALUES 1:(10,10),1:(20,20);
Execution succeeded (time spent 2227/2542 us)

Sat, 23 Oct 2021 22:31:14 CST

(root@nebula) [test]> lookup on t2 where t2.num1<15 yield t2.num1,t2.num2;
+----------+---------+---------+
| VertexID | t2.num1 | t2.num2 |
+----------+---------+---------+
| 1        | 20      | 20      |
+----------+---------+---------+
Got 1 rows (time spent 2870/3214 us)

Sat, 23 Oct 2021 22:31:38 CST

(root@nebula) [test]> lookup on t2 where t2.num1>15 yield t2.num1,t2.num2;
+----------+---------+---------+
| VertexID | t2.num1 | t2.num2 |
+----------+---------+---------+
| 1        | 20      | 20      |
+----------+---------+---------+
Got 1 rows (time spent 3065/3424 us)

Sat, 23 Oct 2021 22:31:44 CST

(root@nebula) [test]> lookup on t2 where t2.num1>15 yield t2.num1;
+----------+---------+
| VertexID | t2.num1 |
+----------+---------+
| 1        | 20      |
+----------+---------+
Got 1 rows (time spent 3599/3991 us)

Sat, 23 Oct 2021 22:47:45 CST

(root@nebula) [test]> lookup on t2 where t2.num1<15 yield t2.num1;
+----------+---------+
| VertexID | t2.num1 |
+----------+---------+
| 1        | 10      |
+----------+---------+
Got 1 rows (time spent 2995/3325 us)

Sat, 23 Oct 2021 22:47:51 CST

When inserting multiple rows at the same time in the insert statement but the vid of each row is the same, and there is an index on this tag, then two different index keys will be generated on the storage but point to the same vertex.

Your Environments (must be provided)

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

How To Reproduce(must be provided)

Steps to reproduce the behavior:

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

Expected behavior

A clear and concise description of what you expected to happen.

Additional context

Provide logs and configs, or any other context to trace the problem.

@cangfengzhs cangfengzhs added the type/bug Type: something is unexpected label Oct 23, 2021
@Sophie-Xie Sophie-Xie added this to the v3.0.0 milestone Oct 25, 2021
critical27 added a commit to critical27/nebula that referenced this issue Oct 25, 2021
critical27 added a commit to critical27/nebula that referenced this issue Oct 25, 2021
@Shylock-Hg
Copy link
Contributor

Shylock-Hg commented Oct 25, 2021

Maybe insert duplicate vertices/edges in one statement should report error.

@cangfengzhs
Copy link
Contributor Author

Maybe insert duplicate vertices/edges in one statement should report error.

I think it should behave the same as insert one by one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Type: something is unexpected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants