-
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
remove read lock in meta client #3256
Conversation
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.
Good job. After I review the code, some places you need to pay attention:
- You only handle the structure in
SpaceInfoCache
, I think some function is missing, for examplegetTagSchemaFromCache
,getLatestTagVersionFromCache
and so on. In fact, almost all function withfolly::RWSpinLock::ReadHolder
should be taken care. - Just delete the commented code, don't keep them in the old place
You could do some simple performance test using k6 or something else. This PR is very sensitive to performance.
There are 5 remain read lock in 667 2319 2360 2383 2395 line. |
Codecov Report
@@ Coverage Diff @@
## master #3256 +/- ##
==========================================
- Coverage 85.29% 85.27% -0.03%
==========================================
Files 1305 1305
Lines 120383 120443 +60
==========================================
+ Hits 102683 102710 +27
- Misses 17700 17733 +33
Continue to review full report at Codecov.
|
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.
Good job!
src/clients/meta/MetaClient.cpp
Outdated
return true; | ||
} | ||
|
||
static Indexes __buildIndexes(std::vector<cpp2::IndexItem> indexItemVec) { |
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.
Please pay attention to the name style, we don't use __
as prefix.
src/clients/meta/MetaClient.cpp
Outdated
// edgeSchemas[edgeIt.get_edge_type()].resize(schema->getVersion() + 1); | ||
// lastEdgeType = edgeIt.get_edge_type(); | ||
// } | ||
// edgeSchemas[edgeIt.get_edge_type()][schema->getVersion()] = std::move(schema); |
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.
Just delete them, if you are sure that you are doing the right thing.
I see, my bad, Github has fold some function name... |
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.
Well done, LGTM
* add one * test * test * test * add more debug Info * Revert "add more debug Info" This reverts commit 90ef647. * remove * wip * finish * remove redundant variable * remove annotation * remove more rlock Co-authored-by: cpw <13495049+CPWstatic@users.noreply.github.com>
What type of PR is this?
Which issue(s) this PR fixes:
close #3129
What this PR does / why we need it?
reduce the side effect of
read-write locks
Checklist: