You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by GitBox <gi...@apache.org> on 2020/03/24 16:39:55 UTC

[GitHub] [carbondata] ajantha-bhat commented on a change in pull request #3677: [wip]Fix segment cache issue with parallel spark applications on same store

ajantha-bhat commented on a change in pull request #3677: [wip]Fix segment cache issue with parallel spark applications on same store
URL: https://github.com/apache/carbondata/pull/3677#discussion_r397299238
 
 

 ##########
 File path: core/src/main/java/org/apache/carbondata/core/indexstore/blockletindex/BlockletDataMapFactory.java
 ##########
 @@ -369,6 +379,33 @@ private void modifyColumnSchemaForSortColumn(ColumnSchema columnSchema, boolean
     return tableBlockIndexUniqueIdentifiers;
   }
 
+  /**
+   * This case is added for a case where, there are two applications running, and in one application
+   * operations happened like SI rebuild, update or delete case, then the cache should be updated as
+   * well. The cache updation happens for same application, but other application may fail to query
+   * or may give wrong result. Since we overwrite the segment file in these scenarios, check the
+   * timestamp, and if modified, clear from the cache.
+   */
+  private void clearSegmentMapIfSegmentUpdated(String latestSegmentFilePath, Segment segment) {
+    SegmentBlockIndexInfo segmentBlockIndexInfo = segmentMap.get(segment.getSegmentNo());
 
 Review comment:
   For a clean approach, 
   
   Need to use `SegmentRefreshInfo`, for transactional table , only update scenario will use this. can use for normal scenario also. For nontransactional carbon table. Already it is used for this non-update scenario. Refer `LatestFilesReadCommittedScope#takeCarbonIndexFileSnapShot` to see how it is filled.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services