tarantool / queue

Create task queues, add and take jobs, monitor failed tasks
Other
237 stars 52 forks source link

Vinyl engine task ack problem #61

Closed ygdkn closed 7 years ago

ygdkn commented 7 years ago

I tried to use vinyl as storage engine for queue, but face a problem with task acknowledgement. There is an error:

.rocks/share/tarantool/queue/abstract.lua:146: attempt to index a nil value

And it's basically problem with delete method in fifo queue As I can see, reason why this error occured is vinyl engine limitation https://tarantool.org/doc/1.7/book/box/box_space.html#lua-function.space_object.delete

bigbes commented 7 years ago

Fixed

rybakit commented 7 years ago
-    local task = self.space:delete(id)
+    local task = self.space:get(id)
+    self.space:delete(id)

@bigbes Does ^this change^ affect performance for the memtx queues? If so, would it make sense to have something like:

local task
if 'memtx' == self.space.engine then
    task = self.space:delete(id)
else
    task = self.space:get(id)
    self.space:delete(id)
end
bigbes commented 7 years ago

@rybakit You can benchmark. My guess is lot lesser than 1 percent performance change.