snleee commented on a change in pull request #4109: Fixing PerfBenchmarkDriver
URL: https://github.com/apache/incubator-pinot/pull/4109#discussion_r275016684
 
 

 ##########
 File path: 
pinot-tools/src/main/java/org/apache/pinot/tools/perf/PerfBenchmarkDriver.java
 ##########
 @@ -237,18 +239,31 @@ private void startServer()
 
   private void startHelixResourceManager()
       throws Exception {
-    _helixResourceManager = new PinotHelixResourceManager(getControllerConf());
-    _helixResourceManager.start();
-
-    // Create broker tenant.
-    Tenant brokerTenant = new 
TenantBuilder(_brokerTenantName).setRole(TenantRole.BROKER).setTotalInstances(1).build();
-    _helixResourceManager.createBrokerTenant(brokerTenant);
-
-    // Create server tenant.
-    Tenant serverTenant =
-        new 
TenantBuilder(_serverTenantName).setRole(TenantRole.SERVER).setTotalInstances(1).setOfflineInstances(1)
-            .build();
-    _helixResourceManager.createServerTenant(serverTenant);
+    if (_conf.shouldStartController()) {
+      // helix resource manager is already available at this time if 
controller is started
+      _helixResourceManager = _controllerStarter.getHelixResourceManager();
+    } else {
+      // When starting server only, we need to change the controller port to 
avoid registering controller helix
+      // participant with the same host and port.
+      ControllerConf controllerConf = getControllerConf();
+      
controllerConf.setControllerPort(Integer.toString(_conf.getControllerPort() + 
1));
 
 Review comment:
   Good point. I already attempted that approach but we have some limits. We 
can easily change it for tenants and table creation. However, one issue is that 
we are taking different code path for segment upload. `addNewSegment()` is used 
for mostly tests and the function only updates `segmentZkMetadata`. We use this 
approach because extracted segment files are already available when starting a 
server in a perfBenchmarkRunner. If we want to use the controller API, we will 
have to tar segment files and upload to controller.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to