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

All memcached tests fail with tarantool 2.10.0-beta1-376-gd2a012455 (master branch) #96

Closed
ylobankov opened this issue Dec 21, 2021 · 3 comments · Fixed by #102
Closed
Assignees
Labels
bug Something isn't working

Comments

@ylobankov
Copy link
Contributor

ylobankov commented Dec 21, 2021

Host: Ubuntu 20.04

Tarantool:

Tarantool 2.10.0-beta1-376-gd2a012455
Target: Linux-x86_64-RelWithDebInfo
Build options: cmake . -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_BACKTRACE=ON
Compiler: /usr/bin/cc /usr/lib/ccache/g++
C_FLAGS:-g -O2 -fdebug-prefix-map=/build/tarantool-2.10.0~beta1.376.dev=. -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -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:-g -O2 -fdebug-prefix-map=/build/tarantool-2.10.0~beta1.376.dev=. -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -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

Try to run tests:

$ make test-memcached
[  3%] Built target generate_proto_txt_parser_c
[ 11%] Built target msgpuck
[ 55%] Built target small
[100%] Built target internalso
Scanning dependencies of target test-memcached
Started ./test-run.py --force
Collecting tests in 'binary': memcached binary tests.
Found 4 tests.
Collecting tests in 'capable': memcapable integration.
Found 2 tests.
Collecting tests in 'sasl': memcached binary sasl tests.
Found 1 tests.
Collecting tests in 'text': memcached text tests.
Found 10 tests.
Installing the server ...
    Found executable at /usr/bin/tarantool
    Found tarantoolctl at  /usr/bin/tarantoolctl
    Creating and populating working directory in /home/ubuntu/Workspace/memcached/test/var ...
    Found old vardir, deleting ...
Starting the server ...
Starting /home/ubuntu/Workspace/memcached/test/var/binary.lua
Tarantool 2.10.0-beta1-369-g2f55b4168
Target: Linux-x86_64-RelWithDebInfo
Build options: cmake . -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_BACKTRACE=ON
Compiler: /usr/bin/cc /usr/lib/ccache/g++
C_FLAGS:-g -O2 -fdebug-prefix-map=/build/tarantool-2.10.0~beta1.369.dev=. -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -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:-g -O2 -fdebug-prefix-map=/build/tarantool-2.10.0~beta1.369.dev=. -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -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
================================================================================
TEST                                            PARAMS		RESULT
---------------------------------------------------------------------------
binary/binary-boundary.test.py                                  [ disabled ]
binary/binary-expire.test.py                                    Traceback (most recent call last):
  File "/home/ubuntu/Workspace/memcached/test-run/lib/test.py", line 135, in run
    self.execute(server)
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_server.py", line 137, in execute
    execfile(self.name, dict(locals(), **server.__dict__))
  File "binary/binary-expire.test.py", line 40, in <module>
    server.admin("box.space.__mc_memcached:truncate()", silent=True)
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 153, in __call__
    return self.execute(command, silent)
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 142, in execute
    self.opt_reconnect()
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 136, in opt_reconnect
    self.reconnect()
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 121, in reconnect
    self.connect()
  File "/home/ubuntu/Workspace/memcached/test-run/lib/admin_connection.py", line 88, in connect
    super(AdminConnection, self).connect()
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 110, in connect
    self.socket = socket.create_connection((self.host, self.port))
  File "/usr/lib/python2.7/socket.py", line 575, in create_connection
    raise err
error: [Errno 111] Connection refused
[ fail ]
Test failed! Last 10 lines of the result file:
#-----------------------------# test expiration #-----------------------------#

Last 15 lines of Tarantool Log file:
binary/binary-toobig.test.py                                    Traceback (most recent call last):
  File "/home/ubuntu/Workspace/memcached/test-run/lib/test.py", line 135, in run
    self.execute(server)
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_server.py", line 137, in execute
    execfile(self.name, dict(locals(), **server.__dict__))
  File "binary/binary-toobig.test.py", line 12, in <module>
    mc = MemcachedBinaryConnection("127.0.0.1", iproto.py_con.port)
  File "/home/ubuntu/Workspace/memcached/test/binary/internal/memcached_connection.py", line 165, in __init__
    self.connect()
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 110, in connect
    self.socket = socket.create_connection((self.host, self.port))
  File "/usr/lib/python2.7/socket.py", line 575, in create_connection
    raise err
error: [Errno 111] Connection refused
[ fail ]
Test failed! Last 10 lines of the result file:

Last 15 lines of Tarantool Log file:
binary/binary.test.py                                           Traceback (most recent call last):
  File "/home/ubuntu/Workspace/memcached/test-run/lib/test.py", line 135, in run
    self.execute(server)
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_server.py", line 137, in execute
    execfile(self.name, dict(locals(), **server.__dict__))
  File "binary/binary.test.py", line 12, in <module>
    mc = MemcachedBinaryConnection("127.0.0.1", iproto.py_con.port)
  File "/home/ubuntu/Workspace/memcached/test/binary/internal/memcached_connection.py", line 165, in __init__
    self.connect()
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 110, in connect
    self.socket = socket.create_connection((self.host, self.port))
  File "/usr/lib/python2.7/socket.py", line 575, in create_connection
    raise err
error: [Errno 111] Connection refused
[ fail ]
Test failed! Last 10 lines of the result file:

Last 15 lines of Tarantool Log file:
---------------------------------------------------------------------------
Stopping the server ...
Failed 3 tests: binary/binary-expire.test.py, binary/binary-toobig.test.py, binary/binary.test.py.
Installing the server ...
    Found executable at /usr/bin/tarantool
    Found tarantoolctl at  /usr/bin/tarantoolctl
    Creating and populating working directory in /home/ubuntu/Workspace/memcached/test/var ...
    Found old vardir, deleting ...
Starting the server ...
Starting /home/ubuntu/Workspace/memcached/test/var/capable.lua
Tarantool 2.10.0-beta1-369-g2f55b4168
Target: Linux-x86_64-RelWithDebInfo
Build options: cmake . -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_BACKTRACE=ON
Compiler: /usr/bin/cc /usr/lib/ccache/g++
C_FLAGS:-g -O2 -fdebug-prefix-map=/build/tarantool-2.10.0~beta1.369.dev=. -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -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:-g -O2 -fdebug-prefix-map=/build/tarantool-2.10.0~beta1.369.dev=. -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -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
================================================================================
TEST                                            PARAMS		RESULT
---------------------------------------------------------------------------
capable/capable-binary.test.py                                  [ skip ]
capable/capable-text.test.py                                    [ skip ]
---------------------------------------------------------------------------
Stopping the server ...
Installing the server ...
    Found executable at /usr/bin/tarantool
    Found tarantoolctl at  /usr/bin/tarantoolctl
    Creating and populating working directory in /home/ubuntu/Workspace/memcached/test/var ...
    Found old vardir, deleting ...
Starting the server ...
Starting /home/ubuntu/Workspace/memcached/test/var/sasl.lua
Tarantool 2.10.0-beta1-369-g2f55b4168
Target: Linux-x86_64-RelWithDebInfo
Build options: cmake . -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_BACKTRACE=ON
Compiler: /usr/bin/cc /usr/lib/ccache/g++
C_FLAGS:-g -O2 -fdebug-prefix-map=/build/tarantool-2.10.0~beta1.369.dev=. -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -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:-g -O2 -fdebug-prefix-map=/build/tarantool-2.10.0~beta1.369.dev=. -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -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
================================================================================
TEST                                            PARAMS		RESULT
---------------------------------------------------------------------------
sasl/binary-sasl.test.py                                        [ disabled ]
---------------------------------------------------------------------------
Stopping the server ...
Installing the server ...
    Found executable at /usr/bin/tarantool
    Found tarantoolctl at  /usr/bin/tarantoolctl
    Creating and populating working directory in /home/ubuntu/Workspace/memcached/test/var ...
    Found old vardir, deleting ...
Starting the server ...
Starting /home/ubuntu/Workspace/memcached/test/var/text.lua
Tarantool 2.10.0-beta1-369-g2f55b4168
Target: Linux-x86_64-RelWithDebInfo
Build options: cmake . -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_BACKTRACE=ON
Compiler: /usr/bin/cc /usr/lib/ccache/g++
C_FLAGS:-g -O2 -fdebug-prefix-map=/build/tarantool-2.10.0~beta1.369.dev=. -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -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:-g -O2 -fdebug-prefix-map=/build/tarantool-2.10.0~beta1.369.dev=. -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -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
================================================================================
TEST                                            PARAMS		RESULT
---------------------------------------------------------------------------
text/binary-get.test.py                                         Traceback (most recent call last):
  File "/home/ubuntu/Workspace/memcached/test-run/lib/test.py", line 135, in run
    self.execute(server)
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_server.py", line 137, in execute
    execfile(self.name, dict(locals(), **server.__dict__))
  File "text/binary-get.test.py", line 22, in <module>
    mc_client("set %s 0 0 %d\r\n%s\r\n" % (key, blob_len, blob))
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 153, in __call__
    return self.execute(command, silent)
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 143, in execute
    return self.execute_no_reconnect(command, silent)
  File "/home/ubuntu/Workspace/memcached/test/binary/internal/memcached_connection.py", line 558, in execute_no_reconnect
    return self.recv(silent)
  File "/home/ubuntu/Workspace/memcached/test/binary/internal/memcached_connection.py", line 581, in recv
    self.reply_storage(cmd)
  File "/home/ubuntu/Workspace/memcached/test/binary/internal/memcached_connection.py", line 606, in reply_storage
    self.reply_single_line(cmd)
  File "/home/ubuntu/Workspace/memcached/test/binary/internal/memcached_connection.py", line 686, in reply_single_line
    reply = self.read_line() + MEMCACHED_SEPARATOR
  File "/home/ubuntu/Workspace/memcached/test/binary/internal/memcached_connection.py", line 702, in read_line
    data = self.socket.recv(1048576)
error: [Errno 104] Connection reset by peer
[ fail ]
Test failed! Last 10 lines of the result file:
<<--------------------------------------------------
set foo_0 0 0 5
mooo

Last 15 lines of Tarantool Log file:
text/bogus-commands.test.py                                     Traceback (most recent call last):
  File "/home/ubuntu/Workspace/memcached/test-run/lib/test.py", line 135, in run
    self.execute(server)
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_server.py", line 137, in execute
    execfile(self.name, dict(locals(), **server.__dict__))
  File "text/bogus-commands.test.py", line 15, in <module>
    mc_client("boguscommand slkdsldkfjsd\r\n")
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 153, in __call__
    return self.execute(command, silent)
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 142, in execute
    self.opt_reconnect()
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 136, in opt_reconnect
    self.reconnect()
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 121, in reconnect
    self.connect()
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 110, in connect
    self.socket = socket.create_connection((self.host, self.port))
  File "/usr/lib/python2.7/socket.py", line 575, in create_connection
    raise err
error: [Errno 111] Connection refused
[ fail ]
Test failed! Last 10 lines of the result file:

Last 15 lines of Tarantool Log file:
text/cas.test.py                                                Traceback (most recent call last):
  File "/home/ubuntu/Workspace/memcached/test-run/lib/test.py", line 135, in run
    self.execute(server)
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_server.py", line 137, in execute
    execfile(self.name, dict(locals(), **server.__dict__))
  File "text/cas.test.py", line 15, in <module>
    mc_client("cas bad blah 0 0 0\r\n")
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 153, in __call__
    return self.execute(command, silent)
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 142, in execute
    self.opt_reconnect()
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 136, in opt_reconnect
    self.reconnect()
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 121, in reconnect
    self.connect()
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 110, in connect
    self.socket = socket.create_connection((self.host, self.port))
  File "/usr/lib/python2.7/socket.py", line 575, in create_connection
    raise err
error: [Errno 111] Connection refused
[ fail ]
Test failed! Last 10 lines of the result file:

Last 15 lines of Tarantool Log file:
text/expirations.test.py                                        Traceback (most recent call last):
  File "/home/ubuntu/Workspace/memcached/test-run/lib/test.py", line 135, in run
    self.execute(server)
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_server.py", line 137, in execute
    execfile(self.name, dict(locals(), **server.__dict__))
  File "text/expirations.test.py", line 15, in <module>
    master_id = server.get_param('server')['id']
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_server.py", line 807, in get_param
    return yaml.load(self.admin("box.info." + param, silent=True))[0]
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 153, in __call__
    return self.execute(command, silent)
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 142, in execute
    self.opt_reconnect()
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 136, in opt_reconnect
    self.reconnect()
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 121, in reconnect
    self.connect()
  File "/home/ubuntu/Workspace/memcached/test-run/lib/admin_connection.py", line 88, in connect
    super(AdminConnection, self).connect()
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 110, in connect
    self.socket = socket.create_connection((self.host, self.port))
  File "/usr/lib/python2.7/socket.py", line 575, in create_connection
    raise err
error: [Errno 111] Connection refused
[ fail ]
Test failed! Last 10 lines of the result file:

Last 15 lines of Tarantool Log file:
text/flags.test.py                                              Traceback (most recent call last):
  File "/home/ubuntu/Workspace/memcached/test-run/lib/test.py", line 135, in run
    self.execute(server)
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_server.py", line 137, in execute
    execfile(self.name, dict(locals(), **server.__dict__))
  File "text/flags.test.py", line 18, in <module>
    mc_client("set foo %d 0 6\r\nfooval\r\n" % flags)
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 153, in __call__
    return self.execute(command, silent)
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 142, in execute
    self.opt_reconnect()
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 136, in opt_reconnect
    self.reconnect()
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 121, in reconnect
    self.connect()
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 110, in connect
    self.socket = socket.create_connection((self.host, self.port))
  File "/usr/lib/python2.7/socket.py", line 575, in create_connection
    raise err
error: [Errno 111] Connection refused
[ fail ]
Test failed! Last 10 lines of the result file:

Last 15 lines of Tarantool Log file:
text/flush-all.test.py                                          Traceback (most recent call last):
  File "/home/ubuntu/Workspace/memcached/test-run/lib/test.py", line 135, in run
    self.execute(server)
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_server.py", line 137, in execute
    execfile(self.name, dict(locals(), **server.__dict__))
  File "text/flush-all.test.py", line 30, in <module>
    mc_client("set foo 0 0 6\r\nfooval\r\n")
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 153, in __call__
    return self.execute(command, silent)
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 142, in execute
    self.opt_reconnect()
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 136, in opt_reconnect
    self.reconnect()
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 121, in reconnect
    self.connect()
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 110, in connect
    self.socket = socket.create_connection((self.host, self.port))
  File "/usr/lib/python2.7/socket.py", line 575, in create_connection
    raise err
error: [Errno 111] Connection refused
[ fail ]
Test failed! Last 10 lines of the result file:
# Test flush_all with zero delay.

Last 15 lines of Tarantool Log file:
text/getset.test.py                                             Traceback (most recent call last):
  File "/home/ubuntu/Workspace/memcached/test-run/lib/test.py", line 135, in run
    self.execute(server)
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_server.py", line 137, in execute
    execfile(self.name, dict(locals(), **server.__dict__))
  File "text/getset.test.py", line 15, in <module>
    mc_client("flush_all\r\n", silent = True)
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 153, in __call__
    return self.execute(command, silent)
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 142, in execute
    self.opt_reconnect()
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 136, in opt_reconnect
    self.reconnect()
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 121, in reconnect
    self.connect()
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 110, in connect
    self.socket = socket.create_connection((self.host, self.port))
  File "/usr/lib/python2.7/socket.py", line 575, in create_connection
    raise err
error: [Errno 111] Connection refused
[ fail ]
Test failed! Last 10 lines of the result file:

Last 15 lines of Tarantool Log file:
text/incrdecr.test.py                                           Traceback (most recent call last):
  File "/home/ubuntu/Workspace/memcached/test-run/lib/test.py", line 135, in run
    self.execute(server)
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_server.py", line 137, in execute
    execfile(self.name, dict(locals(), **server.__dict__))
  File "text/incrdecr.test.py", line 16, in <module>
    mc_client("set bug21 0 0 19\r\n9223372036854775807\r\n")
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 153, in __call__
    return self.execute(command, silent)
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 142, in execute
    self.opt_reconnect()
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 136, in opt_reconnect
    self.reconnect()
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 121, in reconnect
    self.connect()
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 110, in connect
    self.socket = socket.create_connection((self.host, self.port))
  File "/usr/lib/python2.7/socket.py", line 575, in create_connection
    raise err
error: [Errno 111] Connection refused
[ fail ]
Test failed! Last 10 lines of the result file:
# incr/decr big value

Last 15 lines of Tarantool Log file:
text/multiversioning.test.py                                    Traceback (most recent call last):
  File "/home/ubuntu/Workspace/memcached/test-run/lib/test.py", line 135, in run
    self.execute(server)
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_server.py", line 137, in execute
    execfile(self.name, dict(locals(), **server.__dict__))
  File "text/multiversioning.test.py", line 24, in <module>
    print memcached1("set big 0 0 %d\r\n%s\r\n" % (buf_size, buf), silent = True)
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 153, in __call__
    return self.execute(command, silent)
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 142, in execute
    self.opt_reconnect()
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 136, in opt_reconnect
    self.reconnect()
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 121, in reconnect
    self.connect()
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 110, in connect
    self.socket = socket.create_connection((self.host, self.port))
  File "/usr/lib/python2.7/socket.py", line 575, in create_connection
    raise err
error: [Errno 111] Connection refused
[ fail ]
Test failed! Last 10 lines of the result file:
# Store big in lower case via first memcached client
set big 0 0 262144
<big-value-lower-case>

Last 15 lines of Tarantool Log file:
text/noreply.test.py                                            Traceback (most recent call last):
  File "/home/ubuntu/Workspace/memcached/test-run/lib/test.py", line 135, in run
    self.execute(server)
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_server.py", line 137, in execute
    execfile(self.name, dict(locals(), **server.__dict__))
  File "text/noreply.test.py", line 16, in <module>
    mc_client("flush_all noreply\r\n")
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 153, in __call__
    return self.execute(command, silent)
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 142, in execute
    self.opt_reconnect()
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 136, in opt_reconnect
    self.reconnect()
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 121, in reconnect
    self.connect()
  File "/home/ubuntu/Workspace/memcached/test-run/lib/tarantool_connection.py", line 110, in connect
    self.socket = socket.create_connection((self.host, self.port))
  File "/usr/lib/python2.7/socket.py", line 575, in create_connection
    raise err
error: [Errno 111] Connection refused
[ fail ]
Test failed! Last 10 lines of the result file:
# Test that commands can take 'noreply' parameter.

Last 15 lines of Tarantool Log file:
---------------------------------------------------------------------------
Stopping the server ...
Failed 10 tests: text/binary-get.test.py, text/bogus-commands.test.py, text/cas.test.py, text/expirations.test.py, text/flags.test.py, text/flush-all.test.py, text/getset.test.py, text/incrdecr.test.py, text/multiversioning.test.py, text/noreply.test.py.

===== 13 tests failed:
----- binary/binary-expire.test.py
----- binary/binary-toobig.test.py
----- binary/binary.test.py
----- text/binary-get.test.py
----- text/bogus-commands.test.py
----- text/cas.test.py
----- text/expirations.test.py
----- text/flags.test.py
----- text/flush-all.test.py
----- text/getset.test.py
----- text/incrdecr.test.py
----- text/multiversioning.test.py
----- text/noreply.test.py
[INFO/MainProcess] process shutting down
make[3]: *** [test/CMakeFiles/test-memcached.dir/build.make:57: test/CMakeFiles/test-memcached] Error 255
make[2]: *** [CMakeFiles/Makefile2:1067: test/CMakeFiles/test-memcached.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:1074: test/CMakeFiles/test-memcached.dir/rule] Error 2
make: *** [Makefile:580: test-memcached] Error 2

However, tests work fine with tarantool 2.8.2-80-g69fc3de62.

@ylobankov ylobankov added bug Something isn't working teamE labels Dec 21, 2021
@ligurio
Copy link
Member

ligurio commented Dec 21, 2021

2021-12-21 16:07:08.342 [1839657] main C> entering the event loop                                                                       
tarantool: /home/sergeyb/sources/MRG/memcached/third_party/small/small/slab_cache.c:58: slab_assert: Assertion `pthread_equal(cache->thread_id, pthread_self())' failed.                                                                                                        
[001] binary/binary-expire.test.py                                                                                                      
[001]                                                                                                                                   
[001] [Instance "binary" killed by signal: 6 (SIGABRT)]                                                                                 
[001] Found assertion fail in the results file [/home/sergeyb/sources/MRG/memcached/test/var/001_binary/binary.log]:                        

Tarantool 2.10.0-beta1-376-gd2a012455

@Totktonada
Copy link
Member

Looks related to #59, we had libsmall update in tarantool recently: tarantool/tarantool#6678.

However after tarantool/tarantool#5932 it should not hit us. At least, not due to symbols clash.

I grepped cord_slab_cache() usage:

$ ag cord_slab_cache
memcached/internal/network.c
34:	mempool_create(&ibuf_pool, cord_slab_cache(), sizeof(struct ibuf));
35:	mempool_create(&obuf_pool, cord_slab_cache(), sizeof(struct obuf));
51:	ibuf_create((struct ibuf *)ibuf, cord_slab_cache(), iobuf_readahead);
60:	obuf_create((struct obuf *)obuf, cord_slab_cache(), iobuf_readahead);

memcached/internal/memcached.c
250:	region_create(&con.gc, cord_slab_cache());

memcached/internal/alloc.c
9:	struct slab *slab = slab_get(cord_slab_cache(), len);
31:	if (ptr) slab_put(cord_slab_cache(), slab_from_data(ptr));

At least we try to use module's region_create() together with tarantool's slab cache. We also try to use memcached's slab_get() / slab_put() with tarantool's slab cache.

ylobankov added a commit that referenced this issue Dec 23, 2021
This patch skips tests run for tarantool 2.10 in reusable_testing.yml
workflow due to the bug [1]. After [1] is fixed, the skip condition
should be removed from the workflow.

[1] #96
ylobankov added a commit that referenced this issue Dec 24, 2021
This patch skips tests run for tarantool 2.10 in reusable_testing.yml
workflow due to the bug [1]. After [1] is fixed, the skip condition
should be removed from the workflow.

[1] #96
ylobankov added a commit that referenced this issue Dec 27, 2021
This patch skips tests run for tarantool 2.10 in reusable_testing.yml
workflow due to the bug [1]. After [1] is fixed, the skip condition
should be removed from the workflow.

[1] #96
ylobankov added a commit that referenced this issue Dec 28, 2021
This patch skips tests run for tarantool 2.10 in reusable_testing.yml
workflow due to the bug [1]. After [1] is fixed, the skip condition
should be removed from the workflow.

[1] #96
@Totktonada Totktonada added the 8sp label Dec 30, 2021
ligurio added a commit that referenced this issue Feb 10, 2022
ligurio added a commit that referenced this issue Feb 10, 2022
ligurio added a commit that referenced this issue Feb 10, 2022
Historically memcached module uses slab cache created by Tarantool.
Fibers get access to it via call of function cord_slab_cache() that is a
part of Tarantool C API. The problem is happen when memcached and
Tarantool use different versions of Small library where ABI is broken.
Issues #59 and #96 are examples of such problems.

We decided use independent slab arena in memcached module to avoid such
problems in future and this patch implements it.

Below I'll describe what is important in switching to own arena.

memcached module uses different types of Small's allocators (ibuf and
obuf used for every network connection, one slab cache used per fiber).
There are two important things with used Small's allocators:

1. some allocators depends on other and sequence of allocations should
   be correct. README in small source code repository has a clear
   description of relationships between allocators [1].
2. some allocators are thread-safe and others not. slab arena is shared
   between all memcached instances, when slab cache allocated on top of
   slab arena is not thread-safe and must be used in scope of fiber.

memcached performs memory allocations and deallocations on different
stages and I would list all these stages explicitly:

- memcached module initialization
- memcached module deinitialization
- memcached instance gc
- memcached instance initialization
- memcached instance start
- memcached instance stop
- memcached instance deinitialization

Most part of these cases covered in tests
test/common/instance_api.test.lua and test/common/module_api.test.lua
that were added in previous commits. The exception here is gc that was
checked manually.

1. https://github.com/tarantool/small

Fixes #96
ligurio added a commit that referenced this issue Feb 10, 2022
Before switching to our own slab arena user can control usage and
information about slab arena using Tarantool Lua API (specifically
box.slab.{check,info,stat}() functions), see [1]. Example of output
box.slab.info() is below:

tarantool> box.slab.info()
---
- items_size: 146896
  items_used_ratio: 26.05%
  quota_size: 268435456
  quota_used_ratio: 12.50%
  arena_used_ratio: 3.7%
  items_used: 38264
  quota_used: 33554432
  arena_size: 33554432
  arena_used: 1234296
...

With our own slab arena we need a way to obtain information about arena.
It's a reason why new method slab() was introduced. Output of slab() is
similar to output from `box.slab.info()`, but without items_size,
items_used, items_used_ratio and arena_used is not implemented.

tarantool> require('memcached'):slab()
---
- info:
    quota_used: 4194304
    arena_used_ratio: 0
    quota_used_ratio: 0.097656249999998
    arena_size: 4194304
    quota_size: 4294967296
    arena_used: 0
...

1. https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_slab/slab_info/

Follows up #96
ligurio added a commit that referenced this issue Feb 10, 2022
Testing for Tarantool 2.10 has been disabled in commit "github-ci: skip running
tests for tarantool 2.10" (763c73d) due to
issue #96. This patch reverts these changes because #96 is fixed.

Follows up #96
ligurio added a commit that referenced this issue Feb 11, 2022
Before switching to our own slab arena user can control usage and
information about slab arena using Tarantool Lua API (specifically
box.slab.{check,info,stat}() functions), see [1]. Example of output
box.slab.info() is below:

tarantool> box.slab.info()
---
- items_size: 146896
  items_used_ratio: 26.05%
  quota_size: 268435456
  quota_used_ratio: 12.50%
  arena_used_ratio: 3.7%
  items_used: 38264
  quota_used: 33554432
  arena_size: 33554432
  arena_used: 1234296
...

With our own slab arena we need a way to obtain information about arena.
It's a reason why new method slab() was introduced. Output of slab() is
similar to output from `box.slab.info()`, but without items_size,
items_used, items_used_ratio and arena_used is not implemented.

tarantool> require('memcached'):slab()
---
- info:
    quota_used: 4194304
    arena_used_ratio: 0
    quota_used_ratio: 0.097656249999998
    arena_size: 4194304
    quota_size: 4294967296
    arena_used: 0
...

1. https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_slab/slab_info/

Follows up #96
ligurio added a commit that referenced this issue Feb 11, 2022
Testing for Tarantool 2.10 has been disabled in commit "github-ci: skip running
tests for tarantool 2.10" (763c73d) due to
issue #96. This patch reverts these changes because #96 is fixed.

Follows up #96
ligurio added a commit that referenced this issue Feb 11, 2022
Before switching to our own slab arena user can control usage and
information about slab arena using Tarantool Lua API (specifically
box.slab.{check,info,stat}() functions), see [1]. Example of output
box.slab.info() is below:

tarantool> box.slab.info()
---
- items_size: 146896
  items_used_ratio: 26.05%
  quota_size: 268435456
  quota_used_ratio: 12.50%
  arena_used_ratio: 3.7%
  items_used: 38264
  quota_used: 33554432
  arena_size: 33554432
  arena_used: 1234296
...

With our own slab arena we need a way to obtain information about arena.
It's a reason why new method slab() was introduced. Output of slab() is
similar to output from `box.slab.info()`, but without items_size,
items_used, items_used_ratio and arena_used is not implemented.

tarantool> require('memcached'):slab()
---
- info:
    quota_used: 4194304
    arena_used_ratio: 0
    quota_used_ratio: 0.097656249999998
    arena_size: 4194304
    quota_size: 4294967296
    arena_used: 0
...

1. https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_slab/slab_info/

Follows up #96
ligurio added a commit that referenced this issue Feb 11, 2022
Testing for Tarantool 2.10 has been disabled in commit "github-ci: skip running
tests for tarantool 2.10" (763c73d) due to
issue #96. This patch reverts these changes because #96 is fixed.

Follows up #96
ligurio added a commit that referenced this issue Feb 11, 2022
ligurio added a commit that referenced this issue Feb 11, 2022
ligurio added a commit that referenced this issue Feb 11, 2022
Historically memcached module uses slab cache created by Tarantool.
Fibers get access to it via call of function cord_slab_cache() that is a
part of Tarantool C API. The problem is happen when memcached and
Tarantool use different versions of Small library where ABI is broken.
Issues #59 and #96 are examples of such problems.

We decided use independent slab arena in memcached module to avoid such
problems in future and this patch implements it.

Below I'll describe what is important in switching to own arena.

memcached module uses different types of Small's allocators (ibuf and
obuf used for every network connection, one slab cache used per fiber).
There are two important things with used Small's allocators:

1. some allocators depends on other and sequence of allocations should
   be correct. README in small source code repository has a clear
   description of relationships between allocators [1].
2. some allocators are thread-safe and others not. slab arena is shared
   between all memcached instances, when slab cache allocated on top of
   slab arena is not thread-safe and must be used in scope of fiber.

memcached performs memory allocations and deallocations on different
stages and I would list all these stages explicitly:

- memcached module initialization
- memcached module deinitialization
- memcached instance gc
- memcached instance initialization
- memcached instance start
- memcached instance stop
- memcached instance deinitialization

Most part of these cases covered in tests
test/common/instance_api.test.lua and test/common/module_api.test.lua
that were added in previous commits. The exception here is gc that was
checked manually.

1. https://github.com/tarantool/small

Fixes #96
ligurio added a commit that referenced this issue Feb 11, 2022
Before switching to our own slab arena user can control usage and
information about slab arena using Tarantool Lua API (specifically
box.slab.{check,info,stat}() functions), see [1]. Example of output
box.slab.info() is below:

tarantool> box.slab.info()
---
- items_size: 146896
  items_used_ratio: 26.05%
  quota_size: 268435456
  quota_used_ratio: 12.50%
  arena_used_ratio: 3.7%
  items_used: 38264
  quota_used: 33554432
  arena_size: 33554432
  arena_used: 1234296
...

With our own slab arena we need a way to obtain information about arena.
It's a reason why new method slab() was introduced. Output of slab() is
similar to output from `box.slab.info()`, but without items_size,
items_used, items_used_ratio and arena_used is not implemented.

tarantool> require('memcached'):slab()
---
- info:
    quota_used: 4194304
    arena_used_ratio: 0
    quota_used_ratio: 0.097656249999998
    arena_size: 4194304
    quota_size: 4294967296
    arena_used: 0
...

1. https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_slab/slab_info/

Follows up #96
ligurio added a commit that referenced this issue Feb 11, 2022
Testing for Tarantool 2.10 has been disabled in commit "github-ci: skip running
tests for tarantool 2.10" (763c73d) due to
issue #96. This patch reverts these changes because #96 is fixed.

Follows up #96
ligurio added a commit that referenced this issue Feb 11, 2022
Historically memcached module uses slab cache created by Tarantool.
Fibers get access to it via call of function cord_slab_cache() that is a
part of Tarantool C API. The problem is happen when memcached and
Tarantool use different versions of Small library where ABI is broken.
Issues #59 and #96 are examples of such problems.

We decided use independent slab arena in memcached module to avoid such
problems in future and this patch implements it.

Below I'll describe what is important in switching to own arena.

memcached module uses different types of Small's allocators (ibuf and
obuf used for every network connection, one slab cache used per fiber).
There are two important things with used Small's allocators:

1. some allocators depends on other and sequence of allocations should
   be correct. README in small source code repository has a clear
   description of relationships between allocators [1].
2. some allocators are thread-safe and others not. slab arena is shared
   between all memcached instances, when slab cache allocated on top of
   slab arena is not thread-safe and must be used in scope of fiber.

memcached performs memory allocations and deallocations on different
stages and I would list all these stages explicitly:

- memcached module initialization
- memcached module deinitialization
- memcached instance gc
- memcached instance initialization
- memcached instance start
- memcached instance stop
- memcached instance deinitialization

Most part of these cases covered in tests
test/common/instance_api.test.lua and test/common/module_api.test.lua
that were added in previous commits. The exception here is gc that was
checked manually.

1. https://github.com/tarantool/small

Fixes #96
ligurio added a commit that referenced this issue Feb 11, 2022
Before switching to our own slab arena user can control usage and
information about slab arena using Tarantool Lua API (specifically
box.slab.{check,info,stat}() functions), see [1]. Example of output
box.slab.info() is below:

tarantool> box.slab.info()
---
- items_size: 146896
  items_used_ratio: 26.05%
  quota_size: 268435456
  quota_used_ratio: 12.50%
  arena_used_ratio: 3.7%
  items_used: 38264
  quota_used: 33554432
  arena_size: 33554432
  arena_used: 1234296
...

With our own slab arena we need a way to obtain information about arena.
It's a reason why new method slab() was introduced. Output of slab() is
similar to output from `box.slab.info()`, but without items_size,
items_used, items_used_ratio and arena_used is not implemented.

tarantool> require('memcached'):slab()
---
- info:
    quota_used: 4194304
    arena_used_ratio: 0
    quota_used_ratio: 0.097656249999998
    arena_size: 4194304
    quota_size: 4294967296
    arena_used: 0
...

1. https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_slab/slab_info/

Follows up #96
ligurio added a commit that referenced this issue Feb 11, 2022
Testing for Tarantool 2.10 has been disabled in commit "github-ci: skip running
tests for tarantool 2.10" (763c73d) due to
issue #96. This patch reverts these changes because #96 is fixed.

Follows up #96
ligurio added a commit that referenced this issue Apr 6, 2022
ligurio added a commit that referenced this issue Apr 6, 2022
Name of internal function for creating a new memcached instance is
memcached_init(). It may be confusing - name can be mixed up with
name of function for module initialization.

In the following commit we will need an explicit function
for module initialization, memcached_init() was renamed to
memcached_create_instance() for clarity.

This commit changes internal function's name, no impact on public API.

Needed for #96
ligurio added a commit that referenced this issue Apr 6, 2022
ligurio added a commit that referenced this issue Apr 6, 2022
Historically memcached module uses slab cache created by Tarantool.
Fibers get access to it via call of function cord_slab_cache() that is a
part of Tarantool C API. The problem is happen when memcached and
Tarantool use different versions of Small library where ABI is broken.
Issues #59 and #96 are examples of such problems.

We decided use independent slab arena in memcached module to avoid such
problems in future and this patch implements it.

Below I'll describe what is important in switching to own arena.

memcached module uses different types of Small's allocators (ibuf and
obuf used for every network connection, one slab cache used per fiber).
There are two important things with used Small's allocators:

1. some allocators depends on other and sequence of allocations should
   be correct. README in small source code repository has a clear
   description of relationships between allocators [1].
2. some allocators are thread-safe and others not. slab arena is shared
   between all memcached instances, when slab cache allocated on top of
   slab arena is not thread-safe and must be used in scope of fiber.

memcached performs memory allocations and deallocations on different
stages and I would list all these stages explicitly:

- memcached module initialization
- memcached module deinitialization
- memcached instance gc
- memcached instance initialization
- memcached instance start
- memcached instance stop
- memcached instance deinitialization

Most part of these cases covered in tests
test/common/instance_api.test.lua and test/common/module_api.test.lua
that were added in previous commits. The exception here is gc that was
checked manually.

In tests function is_port_open() has been replaced to memcached
minimalistic client that do set value, get value with the same key and
compare both values. This check is more rigorous than check port
openess.

1. https://github.com/tarantool/small

Fixes #96
ligurio added a commit that referenced this issue Apr 6, 2022
Before switching to our own slab arena user can control usage and
information about slab arena using Tarantool Lua API (specifically
box.slab.{check,info,stat}() functions), see [1]. Example of output
box.slab.info() is below:

tarantool> box.slab.info()
---
- items_size: 146896
  items_used_ratio: 26.05%
  quota_size: 268435456
  quota_used_ratio: 12.50%
  arena_used_ratio: 3.7%
  items_used: 38264
  quota_used: 33554432
  arena_size: 33554432
  arena_used: 1234296
...

With our own slab arena we need a way to obtain information about arena.
It's a reason why new module function memcached.slab.info() was
introduced. Output of memcached.slab.info() is similar to output
produced by `box.slab.info()`, but without items_size, items_used,
items_used_ratio and arena_used.

tarantool> mc = require('memcached')
creating arena with 4294967295 bytes...
allocate slab cache with slab size 4194304
---
...

tarantool> mc.slab.info()
---
- quota_used: 0
  quota_size: 4294967296
  quota_used_ratio: 0%
...

1. https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_slab/slab_info/

Follows up #96
ligurio added a commit that referenced this issue Apr 6, 2022
Testing for Tarantool 2.10 has been disabled in commit "github-ci: skip running
tests for tarantool 2.10" (763c73d) due to
issue #96. This patch reverts these changes because #96 is fixed.

Follows up #96
ligurio added a commit that referenced this issue Apr 6, 2022
ligurio added a commit that referenced this issue Apr 6, 2022
ligurio added a commit that referenced this issue Apr 6, 2022
Name of internal function for creating a new memcached instance is
memcached_init(). It may be confusing - name can be mixed up with
name of function for module initialization.

In the following commit we will need an explicit function
for module initialization, memcached_init() was renamed to
memcached_create_instance() for clarity.

This commit changes internal function's name, no impact on public API.

Needed for #96
ligurio added a commit that referenced this issue Apr 6, 2022
ligurio added a commit that referenced this issue Apr 6, 2022
Historically memcached module uses slab cache created by Tarantool.
Fibers get access to it via call of function cord_slab_cache() that is a
part of Tarantool C API. The problem is happen when memcached and
Tarantool use different versions of Small library where ABI is broken.
Issues #59 and #96 are examples of such problems.

We decided use independent slab arena in memcached module to avoid such
problems in future and this patch implements it.

Below I'll describe what is important in switching to own arena.

memcached module uses different types of Small's allocators (ibuf and
obuf used for every network connection, one slab cache used per fiber).
There are two important things with used Small's allocators:

1. some allocators depends on other and sequence of allocations should
   be correct. README in small source code repository has a clear
   description of relationships between allocators [1].
2. some allocators are thread-safe and others not. slab arena is shared
   between all memcached instances, when slab cache allocated on top of
   slab arena is not thread-safe and must be used in scope of fiber.

memcached performs memory allocations and deallocations on different
stages and I would list all these stages explicitly:

- memcached module initialization
- memcached module deinitialization
- memcached instance gc
- memcached instance initialization
- memcached instance start
- memcached instance stop
- memcached instance deinitialization

Most part of these cases covered in tests
test/common/instance_api.test.lua and test/common/module_api.test.lua
that were added in previous commits. The exception here is gc that was
checked manually.

In tests function is_port_open() has been replaced to memcached
minimalistic client that do set value, get value with the same key and
compare both values. This check is more rigorous than check port
openess.

1. https://github.com/tarantool/small

Fixes #96
ligurio added a commit that referenced this issue Apr 6, 2022
Before switching to our own slab arena user can control usage and
information about slab arena using Tarantool Lua API (specifically
box.slab.{check,info,stat}() functions), see [1]. Example of output
box.slab.info() is below:

tarantool> box.slab.info()
---
- items_size: 146896
  items_used_ratio: 26.05%
  quota_size: 268435456
  quota_used_ratio: 12.50%
  arena_used_ratio: 3.7%
  items_used: 38264
  quota_used: 33554432
  arena_size: 33554432
  arena_used: 1234296
...

With our own slab arena we need a way to obtain information about arena.
It's a reason why new module function memcached.slab.info() was
introduced. Output of memcached.slab.info() is similar to output
produced by `box.slab.info()`, but without items_size, items_used,
items_used_ratio and arena_used.

tarantool> mc = require('memcached')
creating arena with 4294967295 bytes...
allocate slab cache with slab size 4194304
---
...

tarantool> mc.slab.info()
---
- quota_used: 0
  quota_size: 4294967296
  quota_used_ratio: 0%
...

1. https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_slab/slab_info/

Follows up #96
ligurio added a commit that referenced this issue Apr 6, 2022
Testing for Tarantool 2.10 has been disabled in commit "github-ci: skip running
tests for tarantool 2.10" (763c73d) due to
issue #96. This patch reverts these changes because #96 is fixed.

Follows up #96
ligurio added a commit that referenced this issue Apr 6, 2022
ligurio added a commit that referenced this issue Apr 6, 2022
ligurio added a commit that referenced this issue Apr 6, 2022
ligurio added a commit that referenced this issue Apr 6, 2022
Name of internal function for creating a new memcached instance is
memcached_init(). It may be confusing - name can be mixed up with
name of function for module initialization.

In the following commit we will need an explicit function
for module initialization, memcached_init() was renamed to
memcached_create_instance() for clarity.

This commit changes internal function's name, no impact on public API.

Needed for #96
ligurio added a commit that referenced this issue Apr 6, 2022
ligurio added a commit that referenced this issue Apr 6, 2022
Historically memcached module uses slab cache created by Tarantool.
Fibers get access to it via call of function cord_slab_cache() that is a
part of Tarantool C API. The problem is happen when memcached and
Tarantool use different versions of Small library where ABI is broken.
Issues #59 and #96 are examples of such problems.

We decided use independent slab arena in memcached module to avoid such
problems in future and this patch implements it.

Below I'll describe what is important in switching to own arena.

memcached module uses different types of Small's allocators (ibuf and
obuf used for every network connection, one slab cache used per fiber).
There are two important things with used Small's allocators:

1. some allocators depends on other and sequence of allocations should
   be correct. README in small source code repository has a clear
   description of relationships between allocators [1].
2. some allocators are thread-safe and others not. slab arena is shared
   between all memcached instances, when slab cache allocated on top of
   slab arena is not thread-safe and must be used in scope of fiber.

memcached performs memory allocations and deallocations on different
stages and I would list all these stages explicitly:

- memcached module initialization
- memcached module deinitialization
- memcached instance gc
- memcached instance initialization
- memcached instance start
- memcached instance stop
- memcached instance deinitialization

Most part of these cases covered in tests
test/common/instance_api.test.lua and test/common/module_api.test.lua
that were added in previous commits. The exception here is gc that was
checked manually.

In tests function is_port_open() has been replaced to memcached
minimalistic client that do set value, get value with the same key and
compare both values. This check is more rigorous than check port
openess.

1. https://github.com/tarantool/small

Fixes #96
ligurio added a commit that referenced this issue Apr 6, 2022
Before switching to our own slab arena user can control usage and
information about slab arena using Tarantool Lua API (specifically
box.slab.{check,info,stat}() functions), see [1]. Example of output
box.slab.info() is below:

tarantool> box.slab.info()
---
- items_size: 146896
  items_used_ratio: 26.05%
  quota_size: 268435456
  quota_used_ratio: 12.50%
  arena_used_ratio: 3.7%
  items_used: 38264
  quota_used: 33554432
  arena_size: 33554432
  arena_used: 1234296
...

With our own slab arena we need a way to obtain information about arena.
It's a reason why new module function memcached.slab.info() was
introduced. Output of memcached.slab.info() is similar to output
produced by `box.slab.info()`, but without items_size, items_used,
items_used_ratio and arena_used.

tarantool> mc = require('memcached')
creating arena with 4294967295 bytes...
allocate slab cache with slab size 4194304
---
...

tarantool> mc.slab.info()
---
- quota_used: 0
  quota_size: 4294967296
  quota_used_ratio: 0%
...

1. https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_slab/slab_info/

Follows up #96
ligurio added a commit that referenced this issue Apr 6, 2022
Testing for Tarantool 2.10 has been disabled in commit "github-ci: skip running
tests for tarantool 2.10" (763c73d) due to
issue #96. This patch reverts these changes because #96 is fixed.

Follows up #96
ligurio added a commit that referenced this issue Apr 6, 2022
CuriousGeorgiy added a commit to CuriousGeorgiy/tarantool that referenced this issue Jun 22, 2023
`cord_slab_cache` was not designed to offer a backward compatible API, and
leaving it exposed inevitably leads to errors like those highlighted in
tarantool#7124 and tarantool/memcached#96: hence, remove it from the public API
export.

Closes tarantool#7124

@TarantoolBot document
Title: `cord_slab_cache` was removed from public API export

The `cord_slab_cache` needs to be removed from the C API reference of the
fiber module.
CuriousGeorgiy added a commit to CuriousGeorgiy/tarantool that referenced this issue Jun 22, 2023
`cord_slab_cache` was not designed to offer a backward compatible API, and
leaving it exposed inevitably leads to errors like those highlighted in
tarantool#7124 and tarantool/memcached#96: hence, remove it from the public API
export.

Closes tarantool#7124

@TarantoolBot document
Title: `cord_slab_cache` was removed from public API export

The `cord_slab_cache` needs to be removed from the C API reference of the
fiber module.
CuriousGeorgiy added a commit to CuriousGeorgiy/tarantool that referenced this issue Jun 22, 2023
`cord_slab_cache` was not designed to offer a backward compatible API, and
leaving it exposed inevitably leads to errors like those highlighted in
tarantool#7124 and tarantool/memcached#96: hence, remove it from the public API
export.

Closes tarantool#7124

@TarantoolBot document
Title: `cord_slab_cache` was removed from public API export

The `cord_slab_cache` needs to be removed from the C API reference of the
fiber module.
CuriousGeorgiy added a commit to CuriousGeorgiy/tarantool that referenced this issue Jun 23, 2023
`cord_slab_cache` was not designed to offer a backward compatible API, and
leaving it exposed inevitably leads to errors like those highlighted in
tarantool#7124 and tarantool/memcached#96: hence, remove it from the public API
export.

Closes tarantool#7124

@TarantoolBot document
Title: `cord_slab_cache` was removed from public API export

The `cord_slab_cache` needs to be removed from the C API reference of the
fiber module.
locker pushed a commit to tarantool/tarantool that referenced this issue Jun 23, 2023
`cord_slab_cache` was not designed to offer a backward compatible API, and
leaving it exposed inevitably leads to errors like those highlighted in
#7124 and tarantool/memcached#96: hence, remove it from the public API
export.

Closes #7124

@TarantoolBot document
Title: `cord_slab_cache` was removed from public API export

The `cord_slab_cache` needs to be removed from the C API reference of the
fiber module.
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

Successfully merging a pull request may close this issue.

3 participants