Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fifo: fix data race for put()/take() with vinyl
put()/take() contains two parts: 1. Get a tuple from an index. 2. Insert a next tuple (with id based on the data from the first call)/update the current one. For the vinyl engine it could lead to yield on the second step. As result we could put a tuple with the same id or got the same task multiple times. This is a potential problem. It is very unlikely to get yield on the second place because changes occur in the same place in memory. So it is should not to be flushed from memory to disk right after getting a tuple. But it could happen on practice, see a problem with auto increment and concurrent lookups [1]. This issue has been fixed before for fifottl driver [2][3]. Here I tried to fix it in a similar code style to make it easier to maintain the code. 1. tarantool/tarantool#389 2. #28 3. #30
- Loading branch information