Ok, now I see how #4049 is relevant.

Two things need to be done:
 1) Highlight, by adding comments, that `StringDimensionIndexer`s are updated 
before `indexIncrement` (which is better renamed to something like 
`lastRowIndex`) is incremented. (To ensure this is not violated during some 
refactoring.)
 2) Simple `ArrayList` is still not enough. This line in the `ArrayList`'s 
`grow()` method:
```java
elementData = Arrays.copyOf(elementData, newCapacity);
```
Lacks a write barrier between `Arrays.copyOf()` and the assignment. It means 
that a parallel thread may read the new array from the `elementData` field 
before seeing effects of `Arrays.copyOf()`. This could be fixed by creating a 
minimal implementation of `ArrayList` with `volatile` `elementData` (without 
any CAS or CoW logic that I mentioned earlier).

[ Full content available at: 
https://github.com/apache/incubator-druid/issues/6322 ]
This message was relayed via gitbox.apache.org for devnull@infra.apache.org

Reply via email to