[GitHub] carbondata pull request #2239: [CARBONDATA-2408] Fix search mode master Sasl...

classic Classic list List threaded Threaded
70 messages Options
1234
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #2239: [CARBONDATA-2408] Fix search mode master Sasl...

qiuchenjian-2
GitHub user xubo245 opened a pull request:

    https://github.com/apache/carbondata/pull/2239

    [CARBONDATA-2408] Fix search mode master SaslException issue in the first time

   
    Before register to master, the master maybe not finished the start service.
   
    Fix method:
       
        Waiting for search mode master thread finished and wait for request. And then start workers.
   
   
    Be sure to do all of the following checklist to help us incorporate
    your contribution quickly and easily:
   
     - [ ] Any interfaces changed?
     
     - [ ] Any backward compatibility impacted?
     
     - [ ] Document update required?
   
     - [ ] Testing done
            Please provide details on
            - Whether new unit test cases have been added or why no new tests are required?
            - How it is tested? Please attach test report.
            - Is it a performance related change? Please attach the performance test report.
            - Any additional information to help reviewers in testing this change.
           
     - [ ] For large changes, please consider breaking it into sub-tasks under an umbrella JIRA.
   


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/xubo245/carbondata CARBONDATA-2408-registerToMaster

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/carbondata/pull/2239.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2239
   
----
commit 276a0c97df69dcfa253fa9d453763979d4cb5c13
Author: xubo245 <601450868@...>
Date:   2018-04-27T08:38:44Z

    [CARBONDATA-2408] Fix search mode master SaslException issue in first start
   
    Before register to master, the master maybe not finished the start service.
   
    revert the ime

----


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2239: [CARBONDATA-2408] Fix search mode master SaslExcepti...

qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2239
 
    Build Failed  with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/5458/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2239: [CARBONDATA-2408] Fix search mode master SaslExcepti...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2239
 
    Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/4293/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #2239: [CARBONDATA-2408] Fix search mode master Sasl...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2239#discussion_r184649653
 
    --- Diff: store/search/src/main/scala/org/apache/spark/rpc/Master.scala ---
    @@ -69,20 +69,32 @@ class Master(sparkConf: SparkConf, port: Int) {
       }
     
       /** start service and listen on port passed in constructor */
    -  def startService(): Unit = {
    +  def startService(message: MasterStatus): Unit = {
    --- End diff --
   
    instead of adding this parameter, you can add a isStarted method in Master, and use it in SparkCarbonStore


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #2239: [CARBONDATA-2408] Fix search mode master Sasl...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2239#discussion_r184649709
 
    --- Diff: store/search/src/main/scala/org/apache/spark/rpc/MasterStatus.scala ---
    @@ -0,0 +1,66 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.spark.rpc
    +
    +/**
    + * For search mode master status control
    + *
    + * @param msg status message
    + */
    +class MasterStatus(var msg: String = "Status") {
    --- End diff --
   
    I think this is not needed


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #2239: [CARBONDATA-2408] Fix search mode master Sasl...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2239#discussion_r184649785
 
    --- Diff: examples/spark2/src/main/scala/org/apache/carbondata/examples/SearchModeExample.scala ---
    @@ -156,7 +156,6 @@ object SearchModeExample {
             s"""
                  SELECT charField, stringField, intField, dateField
                  FROM carbonsession_table
    -             WHERE stringfield = 'spark' AND decimalField > $i % 37
    --- End diff --
   
    why delete this?


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #2239: [CARBONDATA-2408] Fix search mode master Sasl...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user xubo245 commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2239#discussion_r184650673
 
    --- Diff: examples/spark2/src/main/scala/org/apache/carbondata/examples/SearchModeExample.scala ---
    @@ -156,7 +156,6 @@ object SearchModeExample {
             s"""
                  SELECT charField, stringField, intField, dateField
                  FROM carbonsession_table
    -             WHERE stringfield = 'spark' AND decimalField > $i % 37
    --- End diff --
   
    for test it, will keep it.


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #2239: [CARBONDATA-2408] Fix search mode master Sasl...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user xubo245 commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2239#discussion_r184653882
 
    --- Diff: store/search/src/main/scala/org/apache/spark/rpc/Master.scala ---
    @@ -69,20 +69,32 @@ class Master(sparkConf: SparkConf, port: Int) {
       }
     
       /** start service and listen on port passed in constructor */
    -  def startService(): Unit = {
    +  def startService(message: MasterStatus): Unit = {
    --- End diff --
   
    ok, done.


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #2239: [CARBONDATA-2408] Fix search mode master Sasl...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user xubo245 commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2239#discussion_r184653962
 
    --- Diff: store/search/src/main/scala/org/apache/spark/rpc/MasterStatus.scala ---
    @@ -0,0 +1,66 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.spark.rpc
    +
    +/**
    + * For search mode master status control
    + *
    + * @param msg status message
    + */
    +class MasterStatus(var msg: String = "Status") {
    --- End diff --
   
    I remove this one


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2239: [CARBONDATA-2408] Fix search mode master SaslExcepti...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2239
 
    Build Failed  with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/5462/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2239: [CARBONDATA-2408] Fix search mode master SaslExcepti...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2239
 
    Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/4299/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2239: [CARBONDATA-2408] Fix search mode master SaslExcepti...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2239
 
    Build Failed  with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/5467/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2239: [CARBONDATA-2408] Fix search mode master SaslExcepti...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:

    https://github.com/apache/carbondata/pull/2239
 
    SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/4593/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2239: [CARBONDATA-2408] Fix search mode master SaslExcepti...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2239
 
    Build Success with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/4327/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #2239: [CARBONDATA-2408] Fix search mode master Sasl...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user xuchuanyin commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2239#discussion_r184842088
 
    --- Diff: integration/spark2/src/main/scala/org/apache/carbondata/store/SparkCarbonStore.scala ---
    @@ -110,8 +110,16 @@ class SparkCarbonStore extends MetaCachedCarbonStore {
       }
     
       def startSearchMode(): Unit = {
    +    LOG.info("Search mode master start service")
         master = new Master(session.sparkContext.getConf)
         master.startService()
    +    var count = 0
    +    while (!master.isStarted()) {
    +      Thread.sleep(10)
    +      count = count + 1;
    +      LOG.info("Sleeping and waiting search mode master finish start " + count)
    --- End diff --
   
    This log should be printed before action (line 118)


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #2239: [CARBONDATA-2408] Fix search mode master Sasl...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user xuchuanyin commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2239#discussion_r184842350
 
    --- Diff: store/search/src/main/scala/org/apache/spark/rpc/Master.scala ---
    @@ -64,13 +64,29 @@ class Master(sparkConf: SparkConf, port: Int) {
     
       private val scheduler: Scheduler = new Scheduler
     
    +  /**
    +   * flag is the master status, default value is false, which means master not start now.
    +   * if it is true, then search mode master finished start.
    +   */
    +  private var flag: Boolean = false
    +
       def this(sparkConf: SparkConf) = {
         this(sparkConf, CarbonProperties.getSearchMasterPort)
       }
     
    +  /**
    +   * get the status flag info
    +   *
    +   * @return whether master started
    +   */
    +  def isStarted(): Boolean = {
    +    this.flag
    +  }
    +
       /** start service and listen on port passed in constructor */
       def startService(): Unit = {
         if (rpcEnv == null) {
    +      LOG.info("Start search mode  master thread")
    --- End diff --
   
    extra blanks found in"mode  master"


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #2239: [CARBONDATA-2408] Fix search mode master Sasl...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user xuchuanyin commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2239#discussion_r184842192
 
    --- Diff: integration/spark2/src/main/scala/org/apache/carbondata/store/SparkCarbonStore.scala ---
    @@ -110,8 +110,16 @@ class SparkCarbonStore extends MetaCachedCarbonStore {
       }
     
       def startSearchMode(): Unit = {
    --- End diff --
   
    I think the log can be optimized like below:
   
    ```
    "Starting search mode master"
    ```
    ```
    s"Waiting search mode master to start, retrying $count times"
    ```
   
    ```
    Search mode master started
    ```



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #2239: [CARBONDATA-2408] Fix search mode master Sasl...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user xuchuanyin commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2239#discussion_r184842333
 
    --- Diff: integration/spark2/src/main/scala/org/apache/carbondata/store/SparkCarbonStore.scala ---
    @@ -110,8 +110,16 @@ class SparkCarbonStore extends MetaCachedCarbonStore {
       }
     
       def startSearchMode(): Unit = {
    +    LOG.info("Search mode master start service")
         master = new Master(session.sparkContext.getConf)
         master.startService()
    +    var count = 0
    +    while (!master.isStarted()) {
    +      Thread.sleep(10)
    --- End diff --
   
    Is 10ms a proper period?
    What if there is a situation that the master starts too late or failed and there will be a log explosion.
   
    So better to add a maximum retrying counts or time and make the sleeping time dynamic by double it.


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #2239: [CARBONDATA-2408] Fix search mode master Sasl...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user xuchuanyin commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2239#discussion_r184842419
 
    --- Diff: store/search/src/main/scala/org/apache/spark/rpc/Master.scala ---
    @@ -80,9 +96,18 @@ class Master(sparkConf: SparkConf, port: Int) {
               rpcEnv = new NettyRpcEnvFactory().create(config)
               val registryEndpoint: RpcEndpoint = new Registry(rpcEnv, Master.this)
               rpcEnv.setupEndpoint("registry-service", registryEndpoint)
    +          if (!isStarted) {
    --- End diff --
   
    Why not use atomicBoolean? It needs less code.


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #2239: [CARBONDATA-2408] Fix search mode master Sasl...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user xuchuanyin commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2239#discussion_r184842473
 
    --- Diff: store/search/src/main/scala/org/apache/spark/rpc/Master.scala ---
    @@ -80,9 +96,18 @@ class Master(sparkConf: SparkConf, port: Int) {
               rpcEnv = new NettyRpcEnvFactory().create(config)
               val registryEndpoint: RpcEndpoint = new Registry(rpcEnv, Master.this)
               rpcEnv.setupEndpoint("registry-service", registryEndpoint)
    +          if (!isStarted) {
    +            synchronized {
    +              if (!isStarted) {
    +                flag = true
    +              }
    +            }
    +          }
               rpcEnv.awaitTermination()
             }
           }).start()
    +    } else {
    +      LOG.info("rpcEnv exists:" + rpcEnv.address)
    --- End diff --
   
    What does it mean?
    Does it mean the search mode master has already started or something wrong?
    Better to optimize the log, for example
    ```
    Search mode master has already been started.
    ``
    OR
    ```
    Address for search mode master has been used by other applications, start failed.
    ```


---
1234