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

[SCB-706]change filters to discovery filters and support invocation based filters #803

Merged
merged 11 commits into from Jul 16, 2018
Merged

Conversation

liubao68
Copy link
Contributor

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Make sure there is a JIRA issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes.
  • Each commit in the pull request should have a meaningful subject line and body.
  • Format the pull request title like [SCB-XXX] Fixes bug in ApproximateQuantiles, where you replace SCB-XXX with the appropriate JIRA issue.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Run mvn clean install to make sure basic checks pass. A more thorough check will be performed on your pull request automatically.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

@liubao68 liubao68 requested review from wujimin and WillemJiang and removed request for wujimin July 11, 2018 15:22
@liubao68
Copy link
Contributor Author

related docs PR: apache/servicecomb-docs#17

@coveralls
Copy link

coveralls commented Jul 12, 2018

Coverage Status

Coverage decreased (-0.03%) to 87.097% when pulling f07e426 on liubao68:test-11 into b00f4c7 on apache:master.

@liubao68 liubao68 closed this Jul 12, 2018
@liubao68 liubao68 reopened this Jul 12, 2018
public boolean equals(Object o) {
if (o instanceof CseServer) {
return this.getHost().equals(((CseServer) o).getHost());
if (o instanceof ServiceCombServer) {
Copy link
Contributor

Choose a reason for hiding this comment

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

rest endpoint equals highway endpoint?
why?

Copy link
Contributor Author

@liubao68 liubao68 Jul 13, 2018

Choose a reason for hiding this comment

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

DiscoveryFilter sees MicroserviceInstance, not Endpoint. And the health check is also to MicroserviceInstance, not Endpoint. I modified server same when MicroserviceInstance is same to make all these place consistence to each other. (like when invocation failed, we mark instance status to failure for one time, but not endpoint failed.)

}

@Override
public List<Server> getFilteredListOfServers(List<Server> servers, Invocation invocation) {
List<Server> filteredServers = new ArrayList<>();
Map<String, String> filterOptions =
Copy link
Contributor

@wujimin wujimin Jul 12, 2018

Choose a reason for hiding this comment

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

seems this is about configuration and instances
better to move to DiscoveryFilter?

so that we can use cache ability?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This filter leaves for compatible, maybe we need provide a new one in future. So I leave it here but not remove it. We can think about your idea in future when needed.

@@ -30,6 +30,9 @@ public DiscoveryTreeNode discovery(DiscoveryContext context, DiscoveryTreeNode p
}

String childName = findChildName(context, parent);
if (childName == null) {
return null;
Copy link
Contributor

Choose a reason for hiding this comment

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

when will this happened?
after return null, DiscoveryTree will throw exception:

// impossible, throw exception to help fix bug
throw new ServiceCombException(filter.getClass().getName() + " discovery return null.");

@liubao68
Copy link
Contributor Author

Since 3 days passed, no more reviews, I am going to merge this PR and doing further integration tests.

@liubao68 liubao68 merged commit 6c4c1c1 into apache:master Jul 16, 2018
@@ -173,7 +173,7 @@ public int getRetryOnSame(String microservice) {
}

public boolean isIsolationFilterOpen(String microservice) {
String p = getStringProperty("false",
String p = getStringProperty("true",
Copy link
Member

Choose a reason for hiding this comment

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

There are lots of default value changed, not sure if it break the old behavior.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Isolation is not enabled by old version, now we enable it by default and change it's default values. Documents here: https://huaweicse.github.io/servicecomb-java-chassis-doc/zh_CN/references-handlers/loadbalance.html

throw new Error(errMsg, e);
if (!policyClsName.isEmpty()) {
LOGGER.error(Configuration.TRANSACTIONCONTROL_POLICY_KEY_PATTERN + " is not supported anymore." +
"You can change this class to SPI, and filters will be loaded by SPI.");
Copy link
Member

Choose a reason for hiding this comment

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

We need to provide a document for the user to upgrade the code the new SPI.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@liubao68 liubao68 deleted the test-11 branch March 9, 2021 10:54
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.

None yet

4 participants