You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by ManoharVanam <gi...@git.apache.org> on 2017/12/28 04:35:31 UTC

[GitHub] carbondata pull request #1734: [CARBONDATA-1912] Handling lock issues for al...

GitHub user ManoharVanam opened a pull request:

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

    [CARBONDATA-1912] Handling lock issues for alter rename operation

    Description : In case of any exception in alter rename operation, need to release all acquired locks
    
    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/ManoharVanam/incubator-carbondata defect1

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

    https://github.com/apache/carbondata/pull/1734.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 #1734
    
----
commit 15f1d4b8c5c3135888cc59ceebc27523b7430162
Author: Manohar <ma...@...>
Date:   2017-12-28T04:33:44Z

    Handling lock issues in case of alter rename operation

----


---

[GitHub] carbondata pull request #1734: [CARBONDATA-1912] Handling lock issues for al...

Posted by ManoharVanam <gi...@git.apache.org>.
Github user ManoharVanam commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1734#discussion_r159025211
  
    --- Diff: integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/schema/CarbonAlterTableRenameCommand.scala ---
    @@ -156,15 +156,20 @@ private[sql] case class CarbonAlterTableRenameCommand(
         } catch {
           case e: Exception =>
             LOGGER.error(e, "Rename table failed: " + e.getMessage)
    -        if (carbonTable != null) {
    -          AlterTableUtil
    -            .revertRenameTableChanges(oldTableIdentifier,
    -              newTableName,
    -              carbonTable.getTablePath,
    -              carbonTable.getCarbonTableIdentifier.getTableId,
    -              timeStamp)(
    -              sparkSession)
    -          renameBadRecords(newTableName, oldTableName, oldDatabaseName)
    +        try {
    +          if (carbonTable != null) {
    +            AlterTableUtil
    +              .revertRenameTableChanges(oldTableIdentifier,
    --- End diff --
    
    done


---

[GitHub] carbondata issue #1734: [CARBONDATA-1912] Handling lock issues for alter ren...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

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



---

[GitHub] carbondata pull request #1734: [CARBONDATA-1912] Handling lock issues for al...

Posted by ManoharVanam <gi...@git.apache.org>.
Github user ManoharVanam commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1734#discussion_r159025214
  
    --- Diff: integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/schema/CarbonAlterTableRenameCommand.scala ---
    @@ -156,15 +156,20 @@ private[sql] case class CarbonAlterTableRenameCommand(
         } catch {
           case e: Exception =>
             LOGGER.error(e, "Rename table failed: " + e.getMessage)
    -        if (carbonTable != null) {
    -          AlterTableUtil
    -            .revertRenameTableChanges(oldTableIdentifier,
    -              newTableName,
    -              carbonTable.getTablePath,
    -              carbonTable.getCarbonTableIdentifier.getTableId,
    -              timeStamp)(
    -              sparkSession)
    -          renameBadRecords(newTableName, oldTableName, oldDatabaseName)
    +        try {
    +          if (carbonTable != null) {
    +            AlterTableUtil
    +              .revertRenameTableChanges(oldTableIdentifier,
    +                newTableName,
    +                carbonTable.getTablePath,
    +                carbonTable.getCarbonTableIdentifier.getTableId,
    +                timeStamp)(
    +                sparkSession)
    +            renameBadRecords(newTableName, oldTableName, oldDatabaseName)
    +          }
    +        } catch {
    +          case e: Exception =>
    --- End diff --
    
    done


---

[GitHub] carbondata pull request #1734: [CARBONDATA-1912] Handling lock issues for al...

Posted by gvramana <gi...@git.apache.org>.
Github user gvramana commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1734#discussion_r159394213
  
    --- Diff: integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/schema/CarbonAlterTableRenameCommand.scala ---
    @@ -156,18 +156,21 @@ private[sql] case class CarbonAlterTableRenameCommand(
         } catch {
           case e: Exception =>
             LOGGER.error(e, "Rename table failed: " + e.getMessage)
    -        if (carbonTable != null) {
    -          AlterTableUtil
    -            .revertRenameTableChanges(oldTableIdentifier,
    +        try {
    --- End diff --
    
    Still it is unknown, when exception is raised before rename or after rename.
    So better handle unlocking at common place and logic and change table path if rename is success.


---

[GitHub] carbondata issue #1734: [CARBONDATA-1912] Handling lock issues for alter ren...

Posted by manishgupta88 <gi...@git.apache.org>.
Github user manishgupta88 commented on the issue:

    https://github.com/apache/carbondata/pull/1734
  
    LGTM....will merge after all builds run


---

[GitHub] carbondata pull request #1734: [CARBONDATA-1912] Handling lock issues for al...

Posted by jackylk <gi...@git.apache.org>.
Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1734#discussion_r158956093
  
    --- Diff: integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/schema/CarbonAlterTableRenameCommand.scala ---
    @@ -156,15 +156,20 @@ private[sql] case class CarbonAlterTableRenameCommand(
         } catch {
           case e: Exception =>
             LOGGER.error(e, "Rename table failed: " + e.getMessage)
    -        if (carbonTable != null) {
    -          AlterTableUtil
    -            .revertRenameTableChanges(oldTableIdentifier,
    -              newTableName,
    -              carbonTable.getTablePath,
    -              carbonTable.getCarbonTableIdentifier.getTableId,
    -              timeStamp)(
    -              sparkSession)
    -          renameBadRecords(newTableName, oldTableName, oldDatabaseName)
    +        try {
    +          if (carbonTable != null) {
    +            AlterTableUtil
    +              .revertRenameTableChanges(oldTableIdentifier,
    +                newTableName,
    +                carbonTable.getTablePath,
    +                carbonTable.getCarbonTableIdentifier.getTableId,
    +                timeStamp)(
    +                sparkSession)
    +            renameBadRecords(newTableName, oldTableName, oldDatabaseName)
    +          }
    +        } catch {
    +          case e: Exception =>
    --- End diff --
    
    use finally, without catch


---

[GitHub] carbondata issue #1734: [CARBONDATA-1912] Handling lock issues for alter ren...

Posted by ravipesala <gi...@git.apache.org>.
Github user ravipesala commented on the issue:

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



---

[GitHub] carbondata issue #1734: [CARBONDATA-1912] Handling lock issues for alter ren...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

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



---

[GitHub] carbondata pull request #1734: [CARBONDATA-1912] Handling lock issues for al...

Posted by jackylk <gi...@git.apache.org>.
Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1734#discussion_r158955988
  
    --- Diff: integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/schema/CarbonAlterTableRenameCommand.scala ---
    @@ -156,15 +156,20 @@ private[sql] case class CarbonAlterTableRenameCommand(
         } catch {
           case e: Exception =>
             LOGGER.error(e, "Rename table failed: " + e.getMessage)
    -        if (carbonTable != null) {
    -          AlterTableUtil
    -            .revertRenameTableChanges(oldTableIdentifier,
    -              newTableName,
    -              carbonTable.getTablePath,
    -              carbonTable.getCarbonTableIdentifier.getTableId,
    -              timeStamp)(
    -              sparkSession)
    -          renameBadRecords(newTableName, oldTableName, oldDatabaseName)
    +        try {
    +          if (carbonTable != null) {
    +            AlterTableUtil
    +              .revertRenameTableChanges(oldTableIdentifier,
    --- End diff --
    
    please follow code convention: 
    ```
         AlterTableUtil. revertRenameTableChanges(
             xxx,
             yyy
         )
    ```


---

[GitHub] carbondata issue #1734: [CARBONDATA-1912] Handling lock issues for alter ren...

Posted by ravipesala <gi...@git.apache.org>.
Github user ravipesala commented on the issue:

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



---

[GitHub] carbondata issue #1734: [CARBONDATA-1912] Handling lock issues for alter ren...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1734
  
    Build Failed with Spark 2.2.0, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/1166/



---

[GitHub] carbondata issue #1734: [CARBONDATA-1912] Handling lock issues for alter ren...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

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



---

[GitHub] carbondata issue #1734: [CARBONDATA-1912] Handling lock issues for alter ren...

Posted by ManoharVanam <gi...@git.apache.org>.
Github user ManoharVanam commented on the issue:

    https://github.com/apache/carbondata/pull/1734
  
    retest this please


---

[GitHub] carbondata pull request #1734: [CARBONDATA-1912] Handling lock issues for al...

Posted by ManoharVanam <gi...@git.apache.org>.
Github user ManoharVanam commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1734#discussion_r159024740
  
    --- Diff: integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/schema/CarbonAlterTableRenameCommand.scala ---
    @@ -156,15 +156,20 @@ private[sql] case class CarbonAlterTableRenameCommand(
         } catch {
           case e: Exception =>
             LOGGER.error(e, "Rename table failed: " + e.getMessage)
    -        if (carbonTable != null) {
    -          AlterTableUtil
    -            .revertRenameTableChanges(oldTableIdentifier,
    -              newTableName,
    -              carbonTable.getTablePath,
    -              carbonTable.getCarbonTableIdentifier.getTableId,
    -              timeStamp)(
    -              sparkSession)
    -          renameBadRecords(newTableName, oldTableName, oldDatabaseName)
    +        try {
    +          if (carbonTable != null) {
    +            AlterTableUtil
    +              .revertRenameTableChanges(oldTableIdentifier,
    +                newTableName,
    +                carbonTable.getTablePath,
    +                carbonTable.getCarbonTableIdentifier.getTableId,
    +                timeStamp)(
    +                sparkSession)
    +            renameBadRecords(newTableName, oldTableName, oldDatabaseName)
    +          }
    +        } catch {
    +          case e: Exception =>
    --- End diff --
    
    Here We need to release all old table acquired locks only in case of any exception. 


---

[GitHub] carbondata issue #1734: [CARBONDATA-1912] Handling lock issues for alter ren...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1734
  
    Build Failed with Spark 2.2.0, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/1162/



---

[GitHub] carbondata issue #1734: [CARBONDATA-1912] Handling lock issues for alter ren...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

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



---

[GitHub] carbondata issue #1734: [CARBONDATA-1912] Handling lock issues for alter ren...

Posted by ravipesala <gi...@git.apache.org>.
Github user ravipesala commented on the issue:

    https://github.com/apache/carbondata/pull/1734
  
    SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/2589/



---

[GitHub] carbondata issue #1734: [CARBONDATA-1912] Handling lock issues for alter ren...

Posted by ravipesala <gi...@git.apache.org>.
Github user ravipesala commented on the issue:

    https://github.com/apache/carbondata/pull/1734
  
    SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/2709/



---

[GitHub] carbondata issue #1734: [CARBONDATA-1912] Handling lock issues for alter ren...

Posted by ManoharVanam <gi...@git.apache.org>.
Github user ManoharVanam commented on the issue:

    https://github.com/apache/carbondata/pull/1734
  
    retest sdv please


---

[GitHub] carbondata issue #1734: [CARBONDATA-1912] Handling lock issues for alter ren...

Posted by manishgupta88 <gi...@git.apache.org>.
Github user manishgupta88 commented on the issue:

    https://github.com/apache/carbondata/pull/1734
  
    LGTM


---

[GitHub] carbondata issue #1734: [CARBONDATA-1912] Handling lock issues for alter ren...

Posted by ManoharVanam <gi...@git.apache.org>.
Github user ManoharVanam commented on the issue:

    https://github.com/apache/carbondata/pull/1734
  
    retest this please


---

[GitHub] carbondata issue #1734: [CARBONDATA-1912] Handling lock issues for alter ren...

Posted by ManoharVanam <gi...@git.apache.org>.
Github user ManoharVanam commented on the issue:

    https://github.com/apache/carbondata/pull/1734
  
    retest sdv please


---

[GitHub] carbondata issue #1734: [CARBONDATA-1912] Handling lock issues for alter ren...

Posted by manishgupta88 <gi...@git.apache.org>.
Github user manishgupta88 commented on the issue:

    https://github.com/apache/carbondata/pull/1734
  
    @ManoharVanam ...In that case can we change the logger error to warning in case of non existence of file and check whether still the warning log is getting printed. If warning logs are not getting printed in the console then we can make change in the logic instead changing the logic


---

[GitHub] carbondata issue #1734: [CARBONDATA-1912] Handling lock issues for alter ren...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

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



---

[GitHub] carbondata issue #1734: [CARBONDATA-1912] Handling lock issues for alter ren...

Posted by ManoharVanam <gi...@git.apache.org>.
Github user ManoharVanam commented on the issue:

    https://github.com/apache/carbondata/pull/1734
  
    @manishgupta88  If operation is success, unlock will try to delete lock file from old table ( which doesn't exists) so error will be printed on spark sql console. So release old table lock only in case of exception. 


---

[GitHub] carbondata issue #1734: [CARBONDATA-1912] Handling lock issues for alter ren...

Posted by manishgupta88 <gi...@git.apache.org>.
Github user manishgupta88 commented on the issue:

    https://github.com/apache/carbondata/pull/1734
  
    @ManoharVanam...what is need of releasing the locks in catch block when finally block assures that lock is released?


---

[GitHub] carbondata issue #1734: [CARBONDATA-1912] Handling lock issues for alter ren...

Posted by ravipesala <gi...@git.apache.org>.
Github user ravipesala commented on the issue:

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



---

[GitHub] carbondata pull request #1734: [CARBONDATA-1912] Handling lock issues for al...

Posted by ManoharVanam <gi...@git.apache.org>.
Github user ManoharVanam commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1734#discussion_r159605348
  
    --- Diff: integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/schema/CarbonAlterTableRenameCommand.scala ---
    @@ -156,18 +156,21 @@ private[sql] case class CarbonAlterTableRenameCommand(
         } catch {
           case e: Exception =>
             LOGGER.error(e, "Rename table failed: " + e.getMessage)
    -        if (carbonTable != null) {
    -          AlterTableUtil
    -            .revertRenameTableChanges(oldTableIdentifier,
    +        try {
    --- End diff --
    
    done


---

[GitHub] carbondata pull request #1734: [CARBONDATA-1912] Handling lock issues for al...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

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


---

[GitHub] carbondata issue #1734: [CARBONDATA-1912] Handling lock issues for alter ren...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

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



---

[GitHub] carbondata issue #1734: [CARBONDATA-1912] Handling lock issues for alter ren...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1734
  
    Build Failed with Spark 2.2.0, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/1207/



---

[GitHub] carbondata issue #1734: [CARBONDATA-1912] Handling lock issues for alter ren...

Posted by ravipesala <gi...@git.apache.org>.
Github user ravipesala commented on the issue:

    https://github.com/apache/carbondata/pull/1734
  
    SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/2616/



---

[GitHub] carbondata issue #1734: [CARBONDATA-1912] Handling lock issues for alter ren...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/1734
  
    Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/2549/



---