-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
add verteKey #3328
add verteKey #3328
Conversation
check vertex key in fetch
Codecov Report
@@ Coverage Diff @@
## master #3328 +/- ##
==========================================
+ Coverage 85.23% 85.25% +0.02%
==========================================
Files 1277 1277
Lines 119088 119115 +27
==========================================
+ Hits 101502 101555 +53
+ Misses 17586 17560 -26
Continue to review full report at Codecov.
|
@@ -18,7 +18,7 @@ enum class NebulaKeyType : uint32_t { | |||
kSystem = 0x00000004, | |||
kOperation = 0x00000005, | |||
kKeyValue = 0x00000006, | |||
// kVertex = 0x00000007, | |||
kVertex = 0x00000007, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will storing tag/vertex in separate places decrease performance of getting properties of vertex?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There will be a decline, but it is negligible for the following reasons:
- Only when the tag to be read does not exist, will the vertex be judged based on the vertexKey. The probability of this situation is very low.
- Even if the vertexKey is read, it is only a
get()
request, and the overhead is very small. - Someone previously proposed a solution to put
vertexKey
andtagKey
together, and use the method ofprefix
for query. But the performance of rocksdb'sseek()
anditerate()
is very poor, which may be dozens of times that ofget()
. This approach will bring performance degradation instead. Of course this is just a theoretical analysis, I will do a simple experiment if necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
|
I see it, my bad. The reason I suggest to write vertexKey when |
But if user delete a tag whose vertex is not exist, this will insert a vertexKey. This is very abnormal. |
@@ -41,6 +41,7 @@ Feature: Delete int vid of tag | |||
""" | |||
Then the result should be, in any order: | |||
| player.name | player.age | | |||
| EMPTY | EMPTY | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't return a result with all properties empty value when the vertex doesn't exist. The empty response is what we expect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we add a vertexKey
, Delete Tag
will not delete vertex at same time. Vertex is still existed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we plan to support fetch tags on hash("Tim Duncan")
later?
This seems like a natural user demand scenario bcz TagKey and VertexKey are abstracted out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Close #2725 |
check vertex key in fetch
What type of PR is this?
What does this PR do?
part of support vertex without tag
Which issue(s)/PR(s) this PR relates to?
#3123
Close #2725
Special notes for your reviewer, ex. impact of this fix, etc:
There are two remaining issues
EMPTY
. At first I wanted to change it to returnNULL
, but I found that graph would change the execution flow based on the result returned by storage. If storage returnsEMPTY
, graph will think that the corresponding property has not been obtained, and will make a request again in the subsequent execution process; if storage returnsNULL
, graph will think that the value of the property has been obtained, which isNULL
.If it is acceptable to return to EMPTY, there is no need to make changes. Otherwise I need some help from someone who is familiar with graph service.
Update v1(t1)
andDelete v1
are executed concurrently in any order, the final result should be that v1 does not exist (of course, t1, t2 also does not exist), but in the current scheme, the data may be v1(t1) after the execution is completed.In the original design, we considered using locks to maintain consistency, but because the implementation of locks is more complicated, and other people have proposed a simpler solution, we did not adopt the lock solution. But at present, there is still a situation of breaking consistency without using a lock. This problem will be fixed in the future.
Additional context:
Checklist:
Release notes:
Please confirm whether to reflect in release notes and how to describe: