abhioncbr commented on code in PR #11985:
URL: https://github.com/apache/pinot/pull/11985#discussion_r1415456015


##########
pinot-segment-local/src/test/java/org/apache/pinot/segment/local/segment/index/loader/SegmentPreProcessorTest.java:
##########
@@ -1898,15 +1899,19 @@ private File buildTestSegment(final TableConfig 
tableConfig, final Schema schema
   private static void removeMinMaxValuesFromMetadataFile(File indexDir) {
     PropertiesConfiguration configuration = 
SegmentMetadataUtils.getPropertiesConfiguration(indexDir);
     Iterator<String> keys = configuration.getKeys();
+    LinkedList<String> keysToClear = new LinkedList<>();
     while (keys.hasNext()) {
       String key = keys.next();
       if (key.endsWith(V1Constants.MetadataKeys.Column.MIN_VALUE) || 
key.endsWith(
           V1Constants.MetadataKeys.Column.MAX_VALUE) || key.endsWith(
           V1Constants.MetadataKeys.Column.MIN_MAX_VALUE_INVALID)) {
-        configuration.clearProperty(key);
+        keysToClear.add(key);

Review Comment:
   `configuration.clearProperty(key);` results in a concurrent modification 
exception and hence a workaround to clear the keys by first getting the list of 
keys to clear and later clearing it.



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

To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to