Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fifottl queue entries with an explicit ttl get stuck in an odd state #191

Open
mannnick24 opened this issue Sep 19, 2022 · 3 comments
Open
Labels
bug Something isn't working

Comments

@mannnick24
Copy link

when this syntax is used to put data in the buffer

queue.tube.test_buffer:put(data, {ttr=60, ttl=15768000000000000})

You end up with entries that have a ttl of 0 and a large next_event time

issue after the test fails the buffer has entries in a state where the ttl is 0, but next event is large [[select "task_id" from "test_buffer" where "ttl" = 0;]] the entries are not returned from take as they are expired, but they should not have expired

using docker image tarantool/tarantool:2.8.4
and a nodejs client

Place tarantool --version output here.
Tarantool 2.8.4-0-g47e6bd362
Target: Linux-x86_64-RelWithDebInfo
Build options: cmake . -DCMAKE_INSTALL_PREFIX=/usr/local -DENABLE_BACKTRACE=ON
Compiler: /usr/bin/cc /usr/bin/c++
C_FLAGS: -fexceptions -funwind-tables -fno-omit-frame-pointer -fno-stack-protector -fno-common -fopenmp -msse2 -std=c11 -Wall -Wextra -Wno-strict-aliasing -Wno-char-subscripts -Wno-format-truncation -Wno-gnu-alignof-expression -fno-gnu89-inline -Wno-cast-function-type
CXX_FLAGS: -fexceptions -funwind-tables -fno-omit-frame-pointer -fno-stack-protector -fno-common -fopenmp -msse2 -std=c++11 -Wall -Wextra -Wno-strict-aliasing -Wno-char-subscripts -Wno-format-truncation -Wno-invalid-offsetof -Wno-gnu-alignof-expression -Wno-cast-function-type

Steps to reproduce
see the project at
https://github.com/mannnick24/tarantool-fifottl-explicit-ttl/blob/main/docker/Dockerfile
this code uses node tarantool connection to concurrently call queue.tube.test_buffer:take, queue.tube.test_buffer:put and queue.tube.test_buffer:ack

How to run:

npm i

build.sh (in docker)

npm run test

Actual behavior
after the test fails the buffer has entries in a state where the ttl is 0, but next event is large [[select "task_id" from "test_buffer" where "ttl" = 0;]] the entries are not returned from take as they are expired, but they should not have expired

e.g. box.execute([[select "task_id", "status", "created", "ttr", "ttl", "next_event" from "el_buffer" where "ttl" = 0 limit 20;]])

metadata:

name: task_id type: unsigned

name: status type: string

name: created type: unsigned

name: ttr type: unsigned

name: ttl type: unsigned

name: next_event type: unsigned rows:

[4, 'r', 1662662470225835, 60000000, 0, 18446744073709551615]

Expected behavior
the buffer would be empty

@mannnick24 mannnick24 added the bug Something isn't working label Sep 19, 2022
@mannnick24
Copy link
Author

mannnick24 commented Sep 20, 2022

further experimenting: the value I was putting in for the ttl was huge
queue.tube.test_buffer:put(data, {ttr=60, ttl=15768000000000000})
when I tried with a more reasonable large number
queue.tube.test_buffer:put(data, {ttr=60, ttl=2000000000})
The test works as expected - so all that's needed is some input validation

@LeonidVas
Copy link
Contributor

Hmm, looks like this issue is more related with https://github.com/tarantool/queue .
So, unless I missed something, I'll move the issue to https://github.com/tarantool/queue .

@LeonidVas LeonidVas transferred this issue from tarantool/tarantool Sep 22, 2022
@LeonidVas
Copy link
Contributor

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants