tarantool / crud

Easy assess to data stored in vshard cluster
BSD 2-Clause "Simplified" License
40 stars 14 forks source link

select: yield on storage tuple lookup #351

Closed DifferentialOrange closed 1 year ago

DifferentialOrange commented 1 year ago

Yield on select/pairs tuple lookup on storage. Fiber yields each yield_every records (same as in count). yield_every should be a positive integer, default is 1000.

crud code contains several while true loops. Three of them are related to the retry strategy. Since retries wraps around net box calls which yield, it shouldn't be dangerous. The other two are in storage select procedure: on after tuple scroll and records filtering. If there are a lot of records which not satisfy any conditions, storage will stuck with 100% CPU load, like in #312. This patch covers these two cases.

There are pairs loops without any yields on router: fields extraction. Since the count of records is not expected to be that big there (we already work with the final set which would be sent to user), this patch doesn't change the behavior on router.

Closes #312

I didn't forget about