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 2019/07/10 13:01:20 UTC

[GitHub] [carbondata] ravipesala commented on a change in pull request #3322: [WIP]Fixed NPE in Concurrent query

ravipesala commented on a change in pull request #3322: [WIP]Fixed NPE in Concurrent query
URL: https://github.com/apache/carbondata/pull/3322#discussion_r302051824
 
 

 ##########
 File path: core/src/main/java/org/apache/carbondata/core/datastore/block/SegmentPropertiesAndSchemaHolder.java
 ##########
 @@ -106,14 +111,16 @@ public int addSegmentProperties(CarbonTable carbonTable,
     SegmentIdAndSegmentPropertiesIndexWrapper segmentIdSetAndIndexWrapper =
         this.segmentPropWrapperToSegmentSetMap.get(segmentPropertiesWrapper);
     if (null == segmentIdSetAndIndexWrapper) {
-      synchronized (getOrCreateTableLock(carbonTable.getAbsoluteTableIdentifier())) {
+      synchronized (getOrCreateTableLock(
+          segmentPropertiesWrapper.carbonTable.getAbsoluteTableIdentifier())) {
         segmentIdSetAndIndexWrapper =
             this.segmentPropWrapperToSegmentSetMap.get(segmentPropertiesWrapper);
         if (null == segmentIdSetAndIndexWrapper) {
           // create new segmentProperties
           segmentPropertiesWrapper.initSegmentProperties();
           segmentPropertiesWrapper.addMinMaxColumns(carbonTable);
           int segmentPropertiesIndex = segmentPropertiesIndexCounter.incrementAndGet();
+          updateDeleteMap(segmentIdSetAndIndexWrapper.getSegmentPropertiesIndex(), -1);
 
 Review comment:
   Is it needed to add -1 while adding? I feel it is better  we can add only when invalidate request comes

----------------------------------------------------------------
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