GitHub user kunal642 opened a pull request:
https://github.com/apache/incubator-carbondata/pull/841 [CARBONDATA-976] Fixed issue for wrong value getting deleted from evolutionEntry Analysis: If alter command throws exception then in the revert flow the condition is to check whether the schemaEvolution time is greater than the lastUpdated time for carbonTable. This leads to problem because if new schema is not written then also the above condition will be true and revert process will happen deleting the previous entry. Solution: Updated the condition to check for the exact time instead of a greater one. You can merge this pull request into a Git repository by running: $ git pull https://github.com/kunal642/incubator-carbondata CARBONDATA-976 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/incubator-carbondata/pull/841.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 #841 ---- commit 06087da248e3bcb7c3da650932cb0d3abd9397c2 Author: kunal642 <[hidden email]> Date: 2017-04-24T06:52:57Z changed revert condition ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at [hidden email] or file a JIRA ticket with INFRA. --- |
Github user CarbonDataQA commented on the issue:
https://github.com/apache/incubator-carbondata/pull/841 Build Failed with Spark 1.6.2, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/1767/ --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at [hidden email] or file a JIRA ticket with INFRA. --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/incubator-carbondata/pull/841 Build Success with Spark 1.6.2, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/1770/ --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at [hidden email] or file a JIRA ticket with INFRA. --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/incubator-carbondata/pull/841 Build Success with Spark 1.6.2, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/1772/ --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at [hidden email] or file a JIRA ticket with INFRA. --- |
In reply to this post by qiuchenjian-2
Github user manishgupta88 commented on a diff in the pull request:
https://github.com/apache/incubator-carbondata/pull/841#discussion_r113147015 --- Diff: integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/AlterTableCommands.scala --- @@ -51,15 +52,15 @@ private[sql] case class AlterTableAddColumns( LOGGER.audit(s"Alter table add columns request has been received for $dbName.$tableName") val locksToBeAcquired = List(LockUsage.METADATA_LOCK, LockUsage.COMPACTION_LOCK) var locks = List.empty[ICarbonLock] - var lastUpdatedTime = 0L + var timeStamp = 0L var newCols = Seq[org.apache.carbondata.core.metadata.schema.table.column.ColumnSchema]() - val carbonTable = CarbonEnv.getInstance(sparkSession).carbonMetastore - .lookupRelation(Some(dbName), tableName)(sparkSession).asInstanceOf[CarbonRelation].tableMeta - .carbonTable + var carbonTable: CarbonTable = null try { - lastUpdatedTime = carbonTable.getTableLastUpdatedTime locks = AlterTableUtil .validateTableAndAcquireLock(dbName, tableName, locksToBeAcquired)(sparkSession) + carbonTable = CarbonEnv.getInstance(sparkSession).carbonMetastore --- End diff -- Add a comment here "Consider a concurrent scenario where 2 alter operations are executed in parallel. 1st operation is success and updates the schema file. 2nd operation will get the lock after completion of 1st operation but as look up relation is called before it will have the older carbon table and this can lead to inconsistent state in the system. Therefor look up relation should be called after acquiring the lock" --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at [hidden email] or file a JIRA ticket with INFRA. --- |
In reply to this post by qiuchenjian-2
Github user manishgupta88 commented on a diff in the pull request:
https://github.com/apache/incubator-carbondata/pull/841#discussion_r113147895 --- Diff: integration/spark2/src/test/scala/org/apache/spark/carbondata/restructure/rowreader/AddColumnTestCases.scala --- @@ -207,6 +209,27 @@ class AddColumnTestCases extends QueryTest with BeforeAndAfterAll { } } + test ("test to check if exception is thrown if table is locked for updation") { + intercept[Exception] { + sql("DROP TABLE IF EXISTS carbon_table") + sql( + "CREATE TABLE carbon_table(intField int,stringField string,charField string,timestampField " + + --- End diff -- Remove these extra empty lines --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at [hidden email] or file a JIRA ticket with INFRA. --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/incubator-carbondata/pull/841 Build Success with Spark 1.6.2, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/1783/ --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at [hidden email] or file a JIRA ticket with INFRA. --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/incubator-carbondata/pull/841 Build Success with Spark 1.6.2, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/1787/ --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at [hidden email] or file a JIRA ticket with INFRA. --- |
Free forum by Nabble | Edit this page |