It is possible to improve concurrency here, I'm not sure that #4049 is 
relevant, but principally because indeed it's a case of single writer - 
multiple readers on an `ArrayList` + `idForNull`.

But just removing synchronization is not good because ArrayList data structure 
itself is racy. When a writer performs `ArrayList.add()` that reallocates 
underlying array a reader may intercept and read `null` for some old id, or get 
an IndexOutOfBoundsException. `ArrayList` should be replaced with a manually 
crafted ArrayList-like data structure, probably making use of CAS and CoW 
principles, that avoids this type of race.

[ 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