Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bugfix: a new written tupitem was not visible to other concurrent GPU…
… cores, then it caused NULL-tupitem assertion. issue reported at heterodb#658 GpuPreAgg(nogroup) write out a result tupitem by the first one. Once the leader thread gets the role of __insertOneTupleNoGroups(), 1. it acquires the exclusive lock (kds_final->nitems == UINT_MAX) 2. it writes out an empty result tuple. 3. it updated the ROW_INDEX(kds_final) by atomic operation. 4. then, unlock the buffer (kds_final->nitems <-- 1) However, reader side didn't use volatile read to fetch the resule tuple-item from ROW_INDEX(kds_final), so it looks here is an empty tuple on the row_index[0] due to code optimization. So, we added volatile qualifier to fetch the row_index[0] not to oversight new values written by the concurrent cores.
- Loading branch information