microsoft / Trill

Trill is a single-node query processor for temporal or streaming data.
MIT License
1.25k stars 133 forks source link

Do not insert into a FastMap while traversing that FastMap #149

Closed peterfreiling closed 3 years ago

peterfreiling commented 3 years ago

Currently, Afa operators use a pattern of traversing a FastMap and inserting into that FastMap during the traversal. While this works most of the time, this can cause problems if the insertion results in the FastMap increasing its capacity and thus rehashing all indexes, thus invalidating the indexes/hashes stored in the traverser. This change modifies all instances of this pattern to store the new elements that need to be inserted into the FastMap and insert them after the traversal completes. Note that these elements will be excluded from the in-progress traversal both before and after this change.