Posted by
Akash R Nilugal (Jira) on
URL: http://apache-carbondata-dev-mailing-list-archive.168.s1.nabble.com/jira-Commented-CARBONDATA-244-Load-and-delete-segment-by-id-queries-giving-inconsistent-results-wheny-tp1043.html
[
https://issues.apache.org/jira/browse/CARBONDATA-244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15496519#comment-15496519 ]
ASF GitHub Bot commented on CARBONDATA-244:
-------------------------------------------
Github user sujith71955 commented on a diff in the pull request:
https://github.com/apache/incubator-carbondata/pull/156#discussion_r79187047
--- Diff: integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CarbonDataRDDFactory.scala ---
@@ -1077,19 +1077,38 @@ object CarbonDataRDDFactory extends Logging {
val segmentStatusManager = new SegmentStatusManager(table.getAbsoluteTableIdentifier)
val details = segmentStatusManager
.readLoadMetadata(loadMetadataFilePath)
+ val carbonTableStatusLock = CarbonLockFactory
+ .getCarbonLockObj(table.getAbsoluteTableIdentifier.getCarbonTableIdentifier,
+ LockUsage.TABLE_STATUS_LOCK)
// Delete marked loads
val isUpdationRequired = DeleteLoadFolders
.deleteLoadFoldersFromFileSystem(carbonLoadModel, hdfsStoreLocation,
partitioner.partitionCount, isForceDeletion, details)
if (isUpdationRequired) {
+ try {
// Update load metadate file after cleaning deleted nodes
- CarbonLoaderUtil.writeLoadMetadata(
- carbonLoadModel.getCarbonDataLoadSchema,
- carbonLoadModel.getDatabaseName,
- carbonLoadModel.getTableName, details.toList.asJava
- )
+ if (carbonTableStatusLock.lockWithRetries()) {
+ logger.info("Table status lock has been successfully acquired.")
+ CarbonLoaderUtil.writeLoadMetadata(
+ carbonLoadModel.getCarbonDataLoadSchema,
+ carbonLoadModel.getDatabaseName,
+ carbonLoadModel.getTableName, details.toList.asJava
+ )
+ }
+ else {
+ val errorMsg = "Clean files request is failed for " + carbonLoadModel.getDatabaseName +
+ "." + carbonLoadModel.getTableName +
+ ". Not able to acquire the table status lock."
--- End diff --
also mention that "due to other operation running in the background ", this message will give more clear picture to user about the task failure
> Load and delete segment by id queries giving inconsistent results when we execute parallely
> -------------------------------------------------------------------------------------------
>
> Key: CARBONDATA-244
> URL:
https://issues.apache.org/jira/browse/CARBONDATA-244> Project: CarbonData
> Issue Type: Bug
> Reporter: Manohar Vanam
> Assignee: Manohar Vanam
>
> Delete segment by id behavior is inconsistent when we Execute load and delete segment by id queries parallely,
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)