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

support: invalid cache through rpc #1357

Merged
merged 13 commits into from
Mar 11, 2021
Merged

support: invalid cache through rpc #1357

merged 13 commits into from
Mar 11, 2021

Conversation

javeme
Copy link
Contributor

@javeme javeme commented Feb 11, 2021

Change-Id: I3fe18cd8c893a84a56fb66df651b78c5e0fe5f4b

Change-Id: I3fe18cd8c893a84a56fb66df651b78c5e0fe5f4b
Change-Id: I65b2da4e8dd3b89440e7c4d715a87ea95d6c14ac
Change-Id: I2f8edb2c70b1ad185f66da527af0e34557c6c889
Change-Id: I4e4abf3b71a6182e8f16af1cd17f60c2690c0767
Change-Id: I8723f401ee430519bc488554c31da16e4fdffdb4
Change-Id: Iefde073a4f07b5bad4cc08f065a3ee0f034114d8
Change-Id: I9c6c5f5e069d2e6f4aad9ec7adbb3dba26de2460
Change-Id: Id45b11844ed5c0a7e6cfb672057c42b455119ba3
@javeme
Copy link
Contributor Author

javeme commented Feb 13, 2021

Cassandra/Scylla ci error:
image

HBase ci error:
image

@codecov
Copy link

codecov bot commented Feb 13, 2021

Codecov Report

Merging #1357 (8da4366) into master (b4c767b) will decrease coverage by 7.11%.
The diff coverage is 40.03%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1357      +/-   ##
============================================
- Coverage     69.19%   62.08%   -7.12%     
- Complexity     5401     5835     +434     
============================================
  Files           328      386      +58     
  Lines         26334    32169    +5835     
  Branches       3750     4492     +742     
============================================
+ Hits          18222    19972    +1750     
- Misses         6333    10168    +3835     
- Partials       1779     2029     +250     
Impacted Files Coverage Δ Complexity Δ
...api/src/main/java/com/baidu/hugegraph/api/API.java 69.04% <ø> (+3.49%) 0.00 <0.00> (ø)
...n/java/com/baidu/hugegraph/api/auth/AccessAPI.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
...n/java/com/baidu/hugegraph/api/auth/BelongAPI.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
...in/java/com/baidu/hugegraph/api/auth/GroupAPI.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
...n/java/com/baidu/hugegraph/api/auth/TargetAPI.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
...ain/java/com/baidu/hugegraph/api/auth/UserAPI.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
...com/baidu/hugegraph/api/gremlin/GremlinClient.java 90.90% <ø> (ø) 0.00 <0.00> (ø)
.../java/com/baidu/hugegraph/api/job/ComputerAPI.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
...va/com/baidu/hugegraph/api/metrics/MetricsAPI.java 65.78% <ø> (ø) 0.00 <0.00> (ø)
...ain/java/com/baidu/hugegraph/api/raft/RaftAPI.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
... and 373 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a50c4c8...8da4366. Read the comment docs.

this.tokens.put(USER_ADMIN, config.get(ServerOptions.ADMIN_TOKEN));
this.tokens.putAll(config.getMap(ServerOptions.USER_TOKENS));
this.tokens.put(USER_ADMIN, config.get(ServerOptions.AUTH_ADMIN_TOKEN));
this.tokens.putAll(config.getMap(ServerOptions.AUTH_USER_TOKENS));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need check AUTH_USER_TOKENS doesn't contains user named 'admin'?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can change their order to ensure the admin stays in the map

String rpcUrl = conf.get(ServerOptions.RPC_REMOTE_URL);
String selfUrl = conf.get(ServerOptions.RPC_SERVER_HOST) + ":" +
conf.get(ServerOptions.RPC_SERVER_PORT);
rpcUrl = execludeSelfUrl(rpcUrl, selfUrl);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exclude

}

if (responses.size() > 0) {
// Just choose one
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

}

private static String methodName(SofaRequest request) {
String method = request.getInterfaceName() + "." +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just return is enough


public void invalid(HugeType type, Id id);

public void invalid2(HugeType type, Object[] ids);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any friendship name?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sofa-rpc don't allowed to use the same method name in a service, may be names like invalidBatch() is more friendship, here just to keep the name short.

Change-Id: I23878e7991774dbb3dcc7723137bac314502cc68
Change-Id: Ia671437ae51f88f8eebb3fcdac20321af65d10a9
Linary
Linary previously approved these changes Mar 2, 2021
Linary
Linary previously approved these changes Mar 3, 2021
return config.refer();
private static String excludeSelfUrl(String rpcUrl, String selfUrl) {
String[] urls = StringUtils.splitWithCommaOrSemicolon(rpcUrl);
Set<String> urlsSet = new LinkedHashSet<>(Arrays.asList(urls));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

urlSet

} else if (excepts.size() > 0) {
throw excepts.get(0);
} else {
assert providers.isEmpty();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check providers.isEmpty() in line 135

Copy link
Contributor Author

@javeme javeme Mar 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

empty provider must come here

Change-Id: Ic24ef99b74edf8e95b701bb6509f127a5d4eee91
Change-Id: I8a8266d7d618410dcff2e882dcbc71c9d71f66e5
@zhoney zhoney merged commit 314fd8a into master Mar 11, 2021
@zhoney zhoney deleted the rpc-invalid-cache branch March 11, 2021 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants