- Oct 07, 2021
-
-
Vladimir Davydov authored
Since all decoding functions except xrow_decode_header() decode a packet body, let's pass an xrow_header object to xrow_on_decode_error() instead of raw pointers to msgpack data. This will simplify packet body decoding functions a bit while in xrow_decode_header() we can use dump_row_hex() directly without hurting readability. While we are at it, make dump_row_hex() static, because it's not used outside its compilation unit.
-
Vladimir Davydov authored
xrow_header_has_key() isn't used anywhere. The purpose of iproto_dml_body_has_key() is unclear - we use it to skip unknown DML keys, but we would skip them anyway in the switch-case down the code path, like we do while decoding other requests. The only useful thing it does is implicitly checks that the key has type MP_UINT, but we can do that explicitly instead.
-
Vladimir Davydov authored
xrow_header_decode() checks that the packet body is a valid msgpack and there's no outstanding data beyond the packet end so we don't need to redo this checks while decoding the body (e.g. in xrow_decode_dml()).
-
- Oct 05, 2021
-
-
Mergen Imeev authored
Prior to this patch, an assertion was thrown if a tuple with an invalid id was inserted into the _priv system space. This bug appeared only in the debug build. Closes #6295
-
EvgenyMekhanik authored
Closes #4909
-
EvgenyMekhanik authored
Fixed error in implementation of `ev_io_closing`: this function is called to do same work as `fd_kill` and should call it after checking fd (in `coio_close` we pass invalid event value, that leads to assertion in new libev version).
-
- Oct 02, 2021
-
-
mechanik20051988 authored
Implement ability to pass timeout to 'fiber:join' function. If timeout expired, join fails with 'timed out' error. Closes #6203 @TarantoolBot document Title: ability to set timeout for 'fiber:join' function was implemented Implement ability to pass timeout to 'fiber:join' function. If timeout expired, join fails with 'timed out' error.
-
- Sep 30, 2021
-
-
mechanik20051988 authored
Add new metrics `REQUESTS_IN_PROGRESS` and `REQUESTS_IN_STREAM_QUEUE` to `box.stat.net`, which contain detailed statistics for iproto requests. These metrics contains same counters as other metrics in `box.stat.net`: current, rps and total. Part of #6293 @TarantoolBot document Title: detailed iproto requests statistics was implemented Add new metrics `REQUESTS_IN_PROGRESS` and `REQUESTS_IN_STREAM_QUEUE` to `box.stat.net`, which contain detailed statistics for iproto requests. These metrics contains same counters as other metrics in `box.stat.net`: current, rps and total. ``` -- statistics for requests currently being processed in tx thread. REQUESTS_IN_PROGRESS: current: -- count of requests currently being processed in the tx thread rps: -- count of requests processed by the tx thread per second total: -- total count of requests processed by tx thread -- statistics for requests placed in queues of streams. REQUESTS_IN_STREAM_QUEUE: current: -- count of requests currently waiting in queues of streams rps: -- count of requests placed in streams queues per second total: -- total count of requests, which was placed in queues of streams for all time ```
-
EvgenyMekhanik authored
In next patch new rmean for iproto thread statistic, that collected in tx thread will be implemented. We need rename IPROTO_LAST constant to make next patch more clear.
-
mechanik20051988 authored
-
mechanik20051988 authored
There was several different function to get iproto statistic, one function for one metric. Since we wan't to add some new metrics it will be better to implement one function for getting all iproto statistic not add several new functions.
-
mechanik20051988 authored
Currently first element in queue of pending requests in stream is a request which was pushed to tx thread for processing. In this patch special pointer to this request (stream->current) was implemented and queue of pending requests now really contains only pending requests.
-
- Sep 28, 2021
-
-
VitaliyaIoffe authored
OSX workflows use brew for install openssl. There was a new release of openssl@3.0 and homebrew updated the openssl formula. Close #6468
-
Vladimir Davydov authored
It never returns NULL anymore, because it uses xmalloc for memory allocations.
-
Vladimir Davydov authored
It never returns NULL anymore, because it uses xmalloc for memory allocations.
-
Vladimir Davydov authored
An mhash is used for allocating system objects. Failing to grow it is likely to render the Tarantool instance unusuable so better fail early. Checks of mh(new) and mh(put) return value will be removed in follow-up patches.
-
Vladimir Davydov authored
We want to use the xmalloc helper throughout the code, not only in the core lib. Move its definition to trivia/util.h and use fprintf+exit instead of say/panic in order not to create circular dependencies.
-
- Sep 27, 2021
-
-
Vladimir Davydov authored
No need to pass them around when we can embed them in netbox_transport. This is a step towards rewriting the netbox state machine in C. Part of #6291
-
Vladimir Davydov authored
There's no need to optimize out fiber.wakeup: - we already have C function calls on the code path; - fiber.wakeup is pretty cheap to be called unconditionally. This is a preparation for moving send/recv buffers to C.
-
Vladimir Davydov authored
Let's recycle buffers in the same place where we reset the transport: when switching the state to 'closed', 'error', or 'error_reconnect'. This is a preparation for moving send/recv buffers to C.
-
Vladimir Davydov authored
In future we will store watchers in this struct. Besides, we can already move send/recv buffers there. So 'registry' is not an appropriate name. Let's rename it to 'transport' - the name which is already used in net.box for a net.box connection implementation object.
-
Vladimir Davydov authored
It stores a socket, not a net.box connection. Let's rename it to sock to avoid confusion.
-
Leonid Vasiliev authored
Exporting symbols of a third party library is not a best practice, as we know from [1]. Let's wrap the msgpack symbols that need to be exported with the "tnt_" prefix. While working on the patch, it was decided to export the msgpack symbols that are used in "msgpuckffi.lua". In test shared libraries where the symbols "mp_***_{decimal,uuid}" are used, they are replaced to exported "tnt_mp_***_{decimal,uuid}", because in the case of linking with "libcore.a" the "libcore.a" needs to be rebuild with the "-fPIC" flag, that seems as overkill for tests. 1. https://github.com/tarantool/memcached/issues/59 Closes #5932
-
- Sep 25, 2021
-
-
Alexander Turenko authored
Before this change `./test-run.py -j -1` always give zero exit code even when there were failed tests. It is the regression from 2.6.0-104-g43482eedc. The `-j -1` is the test-run mode, when it does not execute any parallelization code: don't spawn worker processes and proceed with tests one-by-one from a single process. It was kept just in case, when the parallelization was implemented. AFAIS, it is barely used. Usual `./test-run.py` or `./test-run.py -j N` invocations are not affected. Tarantool's CI is not affected. See https://github.com/tarantool/test-run/pull/313 for details.
-
- Sep 23, 2021
-
-
Andrey Saranchin authored
If we insert a tuple in space with an index that is being built in background, new tuple will or will not be inserted into new index depending on the result of lexicographical comparison with tuple which was inserted into new index last. The problem is hash index is unordered, so background build will not work properly if primary key is HASH index. To avoid this, disable building index in background if primary index is hash. Closes #5977
-
- Sep 22, 2021
-
-
Vladimir Davydov authored
The test uses error injection. Follow-up 0428bbce ("vinyl: fix use of dropped space in deferred DELETE handler").
-
Vladimir Davydov authored
For deferred DELETE statements to be recovered after restart, we write them to a special 'blackhole' system space, _vinyl_deferred_delete, which doesn't store any data, but is logged in the WAL, as a normal space. In the on_replace trigger installed for this space, we insert deferred DELETE statements into the memory (L0) level of the LSM tree corresponding to the space for which the statement was generated. We also wait for L0 quota in the trigger. The problem is a space can be dropped while we are waiting for quota, in which case the trigger function will crash once it resumes execution. To fix this, let's wait for quota before we write the information about the deferred DELETE statement to the _vinyl_deferred_delete space and check if the LSM tree was dropped after yield. This way, everything will work as expected even if a new space is created with the same id, because we don't yield after checking quota. Closes #6448
-
Vladimir Davydov authored
Will come in handy for testing #6448. @TarantoolBot document Title: Document box.stat.vinyl().regulator.blocked_writers The new stat counter shows the number of fibers that are blocked waiting for Vinyl level0 memory quota.
-
- Sep 17, 2021
-
-
Vladimir Davydov authored
The struct is empty.
-
Vladimir Davydov authored
Use a special luaL_serializer with encode_error_as_ext disabled. Default options are propagated to it via an update trigger.
-
Vladimir Davydov authored
This is a preparation for merging serializer_opts into luaL_serializer.
-
Vladimir Davydov authored
It's not needed now, because error marshaling is enabled automatically if the connector supports it (IPROTO_FEATURE_ERROR_EXTENSION is set in IPROTO_ID features). Closes #6428 @TarantoolBot document Title: Drop error_marshaling_enabled session setting box.session.setting.error_marshaling_enabled was used to enable encoding errors returned by CALL/EVAL in the extended format (as the MP_ERROR MsgPack extension). Now, the feature is enabled automatically if the connector supports it (sets IPROTO_FEATURE_ERROR_EXTENSION in IPROTO_ID features).
-
Vladimir Davydov authored
The new IPROTO protocol feature IPROTO_FEATURE_ERROR_EXTENSION enables encoding errors returned by CALL/EVAL commands as the MP_ERROR MsgPack extension. Note, the MP_ERROR extension can still be disabled globally by setting msgpack.cfg.encode_error_as_ext to false. If an IPROTO client doesn't set the feature bit, errors will be encoded as generic cdata objects (converted to strings by default). Needed for #6428 @TarantoolBot document Title: Document IPROTO_FEATURE_ERROR_EXTENSION A new feature bit for the IPROTO_ID command was added: ``` IPROTO_FEATURE_ERROR_EXTENSION = 2 ``` The protocol version was incremented - now it equals 2. If a network client sets this bit, errors returned by CALL/EVAL will be encoded as the MP_ERROR MsgPack extension (unless disabled globally by msgpack.cfg.encode_error_as_ext). If the bit is unset, errors will be encoded according to the serialization rules used for generic cdata objects (converted to strings by default). The built-in net.box connector sets this feature bit. The server sets this feature bit if it supports the MP_ERROR MsgPack extension so a net.box client can explicitly request the feature upon connecting to a server: ```lua net.box.connect(uri, {required_protocol_features = {'error_extension'}}) ```
-
Vladimir Davydov authored
This patch adds a new msgpack.cfg: encode_error_as_ext. Setting it makes msgpack and msgpackffi modules encode errors as the MP_ERROR msgpack extension. If the flag is unset, msgpack.encode behavior depends on encode_load_metatables, encode_use_tostring, and encode_invalid_as_nil options, see luaL_convertfield(), while msgpackffi.encode() will always encode errors as strings. The latter needs to be fixed, but it's out of the scope of this work and tracked separately, see #4499. The new option is enabled by default. Interaction with box.session.settings.error_marshaling_enabled: errors are encoded as the MP_ERROR msgpack extension when returned via IPROTO iff both error_marshaling_enabled and encode_error_as_ext are set. Closes #6433 @TarantoolBot document Title: Document msgpack.cfg.encode_error_as_ext The new option determines how error objects (see box.error.new) are encoded in the msgpack format: - If it's set, errors are encoded as the MP_ERROR msgpack extension. This is the default behavior. - If it's unset, the encoded format depends on other msgpack configuration options (encode_load_metatables, encode_use_tostring, encode_invalid_as_nil). With the otherwise default configuration, they are encoded as strings (see error.message). Functions affected by the default configuration (msgpack.cfg): - msgpack and msgpackffi modules - Storing errors in tuples and spaces (box.tuple.new) - Returning errors from IPROTO CALL/EVAL
-
Vladimir Davydov authored
error_to_mpstream and error_to_mpstream_noext have a lot in common. Factor it out into helper functions.
-
Vladimir Davydov authored
The function doesn't iterate over the stack of errors so it should have suffix '_one', like mp_encode_error_one.
-
Vladimir Davydov authored
It's customary for mp_encode_* functions to take a pointer to the buffer and return a pointer following the end of encoded data. mp_encode_error_one takes (char **) and advances it. Fix it to be consistent with other mp_encode_* functions.
-
Vladimir Davydov authored
There's no reason not to enable extended errors for CALL_16. Enable the feature and add a test. Needed for #6433
-
Vladimir Davydov authored
There's no way to encode an error yet so the test just hard-codes msgpack data. It will be fixed in the future, once we allow to encode errors with msgpack/msgpackffi. Needed for #6433
-
Vladimir Davydov authored
It's not used anymore.
-