You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2021/03/22 12:44:40 UTC

[GitHub] [servicecomb-service-center] robotLJW opened a new pull request #912: [SCB-2094] Add configuration changes for service instance and schema

robotLJW opened a new pull request #912:
URL: https://github.com/apache/servicecomb-service-center/pull/912


   Follow this checklist to help us incorporate your contribution quickly and easily:
   
    - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/SCB) 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 `go build` `go test` `go fmt` `go vet` 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](https://www.apache.org/licenses/icla.pdf).
    - [ ] Never comment source code, delete it.
    - [ ] UT should has "context, subject, expected result" result as test case name, when you call t.Run().
   ---
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-service-center] tianxiaoliang commented on a change in pull request #912: [SCB-2094] Add configuration changes for service instance and schema

Posted by GitBox <gi...@apache.org>.
tianxiaoliang commented on a change in pull request #912:
URL: https://github.com/apache/servicecomb-service-center/pull/912#discussion_r601081990



##########
File path: datasource/mongo/ms.go
##########
@@ -1903,6 +1902,11 @@ func registryInstance(ctx context.Context, request *discovery.RegisterInstanceRe
 	project := util.ParseProject(ctx)
 	remoteIP := util.GetIPFromContext(ctx)
 	instance := request.Instance
+	ttl := int64(instance.HealthCheck.Interval * (instance.HealthCheck.Times + 1))
+
+	instanceFlag := fmt.Sprintf("ttl %ds, endpoints %v, host '%s', serviceID %s",

Review comment:
       不要打host name和endpoints,分别涉及隐私信息和网络拓扑暴露




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-service-center] tianxiaoliang commented on a change in pull request #912: [SCB-2094] Add configuration changes for service instance and schema

Posted by GitBox <gi...@apache.org>.
tianxiaoliang commented on a change in pull request #912:
URL: https://github.com/apache/servicecomb-service-center/pull/912#discussion_r601081990



##########
File path: datasource/mongo/ms.go
##########
@@ -1903,6 +1902,11 @@ func registryInstance(ctx context.Context, request *discovery.RegisterInstanceRe
 	project := util.ParseProject(ctx)
 	remoteIP := util.GetIPFromContext(ctx)
 	instance := request.Instance
+	ttl := int64(instance.HealthCheck.Interval * (instance.HealthCheck.Times + 1))
+
+	instanceFlag := fmt.Sprintf("ttl %ds, endpoints %v, host '%s', serviceID %s",

Review comment:
       不要打host name和endpoints




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-service-center] tianxiaoliang commented on a change in pull request #912: [SCB-2094] Add configuration changes for service instance and schema

Posted by GitBox <gi...@apache.org>.
tianxiaoliang commented on a change in pull request #912:
URL: https://github.com/apache/servicecomb-service-center/pull/912#discussion_r599548459



##########
File path: datasource/mongo/ms.go
##########
@@ -59,7 +60,20 @@ func (ds *DataSource) RegisterService(ctx context.Context, request *discovery.Cr
 	project := util.ParseProject(ctx)
 	serviceFlag := util.StringJoin([]string{
 		service.Environment, service.AppId, service.ServiceName, service.Version}, "/")
-	//todo add quota check
+	domainProject := util.ParseDomainProject(ctx)

Review comment:
       这个service和instance的配额检查都应该在resource层检查,而不是ds层,etcd的实现也该被删除,由resource统一做,因此UT也要做些调整




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-service-center] tianxiaoliang commented on a change in pull request #912: [SCB-2094] Add configuration changes for service instance and schema

Posted by GitBox <gi...@apache.org>.
tianxiaoliang commented on a change in pull request #912:
URL: https://github.com/apache/servicecomb-service-center/pull/912#discussion_r600257103



##########
File path: datasource/mongo/util.go
##########
@@ -107,3 +110,13 @@ func getInstanceCountByDomain(ctx context.Context, svcIDToNonVerKey map[string]s
 	}
 	resp <- ret
 }
+
+func checkQuota(ctx context.Context, domainProject string) *pb.Error {

Review comment:
       这个func应该是公共函数而不属于mongo实现




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-service-center] robotLJW commented on a change in pull request #912: [SCB-2094] Add configuration changes for service instance and schema

Posted by GitBox <gi...@apache.org>.
robotLJW commented on a change in pull request #912:
URL: https://github.com/apache/servicecomb-service-center/pull/912#discussion_r601072573



##########
File path: datasource/mongo/util.go
##########
@@ -107,3 +110,13 @@ func getInstanceCountByDomain(ctx context.Context, svcIDToNonVerKey map[string]s
 	}
 	resp <- ret
 }
+
+func checkQuota(ctx context.Context, domainProject string) *pb.Error {

Review comment:
       已经修改




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-service-center] tianxiaoliang commented on a change in pull request #912: [SCB-2094] Add configuration changes for service instance and schema

Posted by GitBox <gi...@apache.org>.
tianxiaoliang commented on a change in pull request #912:
URL: https://github.com/apache/servicecomb-service-center/pull/912#discussion_r601081990



##########
File path: datasource/mongo/ms.go
##########
@@ -1903,6 +1902,11 @@ func registryInstance(ctx context.Context, request *discovery.RegisterInstanceRe
 	project := util.ParseProject(ctx)
 	remoteIP := util.GetIPFromContext(ctx)
 	instance := request.Instance
+	ttl := int64(instance.HealthCheck.Interval * (instance.HealthCheck.Times + 1))
+
+	instanceFlag := fmt.Sprintf("ttl %ds, endpoints %v, host '%s', serviceID %s",

Review comment:
       不要打host name和endpoints,分别涉及隐私信息和网络拓扑暴露




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-service-center] tianxiaoliang merged pull request #912: [SCB-2094] Add configuration changes for service instance and schema

Posted by GitBox <gi...@apache.org>.
tianxiaoliang merged pull request #912:
URL: https://github.com/apache/servicecomb-service-center/pull/912


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org