- Nov 22, 2021
-
-
Oleg Babin authored
Before this patch test build failed with following error: ``` /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk/usr/include/c++/v1/memory:2666:26: error: unexpected type name '_CompressedPair': expected expression struct _ALIGNAS_TYPE(_CompressedPair) _Storage { ``` This patch seems to be fix this issue. The root of the problem is in "trivia/util.h" module. It defines alignas macros: `#define alignas(_n) __attribute__((aligned(_n)))`. And it seems causes some issues in stdlib internals. To fix this issue let's unconditionally include stdalign.h for C++. According [1] this header should internally define __alignas_is_defined macro. [1] https://en.cppreference.com/w/cpp/language/alignas Part of #6576
-
Mergen Imeev authored
After this patch, all functions that take arguments of one of two or more types have defined a default type, which is used when the argument type cannot be determined. Closes #6483 @TarantoolBot document Title: Default types of SQL built-in functions In case a function takes an argument of one of two or more types, this function has defined the default type for this argument. This type is used when the type of the argument cannot be determined, for example, in the case of a bound variable. Rules for determining default types as follows: 1) When there is only one possible type, it is default. 2) When possible types are INTEGER, DOUBLE or DECIMAL, DECIMAL is default. 3) When possible types are STRING or VARBINARY, STRING is default. 4) When possible data types are any other scalar data type, SCALAR is default. 5) Otherwise, there is no default type.
-
Mergen Imeev authored
After this patch, all SQL built-in functions will work correctly with DECIMAL values. Closes #6355
-
Vladimir Davydov authored
coio_connect() returns a file descriptor so we need to fix the check from != 0 to < 0. Fixes commit ec937bee ("coio: check inet_pton result"). Reported by Coverity.
-
Serge Petrenko authored
coio_accept, coio_read, coio_write, coio_writev used to handle spurious wakeups correctly: if the timeout hasn't passed yet, they would simply retry reading (or writing) and fall asleep once again if no data is ready. This behaviour changed in the following patches: 577a640a ("coio: pass fd to coio_accept") and 4f84859d ("Introduce iostream wrapper for socket I/O"). Now the functions timeout on the very first spurious wakeup. Fix this and add the appropriate unit tests.
-
- Nov 21, 2021
-
-
Vladislav Shpilevoy authored
The tests in here use unix sockets. Should work in parallel fine and not interfere.
-
- Nov 19, 2021
-
-
Vladislav Shpilevoy authored
The test sometimes failed the test cases test_read_only_reason_synchro_no_uuid and test_read_only_reason_election_has_leader_no_uuid. Both relied on an instance being gone from 'replicaset' global internal object in C once it is gone from _cluster. But it wasn't true. If an instance is not visible in _cluster, it could still be not deleted from 'replicaset' because it is done only on WAL write end. So this was a dirty read - the check about an id absent in _cluster. The more reliable way is to check that the replica is gone from box.info.replication - it is built from this 'replicaset' object. Closes #6621
-
- Nov 18, 2021
-
-
Vladimir Davydov authored
Reported by Coverity. While we are at it, let's also mark coio_fill_addrinfo static, because it isn't used outside coio.c.
-
Alexey Vishnyakov authored
**pos is dereferenced before it is checked via *pos == end. This leads to out of bounds access when *pos == end.
-
Vladislav Shpilevoy authored
It got broken in 54be00b6 ("error: use error_payload in Lua"). 2 symbols were dropped from the exports but not from this test. Follow-up #5568
-
Mergen Imeev authored
-
- Nov 17, 2021
-
-
mechanik20051988 authored
The problem was that when we wanted to check that the transaction rolled back after the timeout, we called `fiber.sleep` on the local instance, while the timeout for transaction counted on the remote instance. Fix the text, so now we call `fiber.sleep` on remote server, ensuring that timeout for transaction expires. Closes #6586
-
mechanik20051988 authored
Previously, iproto could only open one socket for listening only. This patch change this behaviour, now user can open several listening sockets. Also in addition to ability to pass uri as a number or string, as previously, ability to pass uri as a table of numbers or strings has been added. Closes #3554 @TarantoolBot document Title: multiple iproto listen sockets Implement ability to open several listening sockets. Implement ability to pass several listening uri as a table of numbers or strings. ```lua box.cfg { listen = {3301, 3302, 3303} } box.cfg { listen = {"127.0.0.1:3301", "127.0.0.1:3302"} } ```
-
mechanik20051988 authored
Previosly `evio_service` was a structure, which encapsulated the work with only one socket. Now this structure contains the array of structs `evio_service_entry` (which work same as previously work `evio_service`). So now struct `evio_service` encapsulates work with any count of sockets. Part of #3554
-
mechanik20051988 authored
According to code style such `init` is a wrong suffix for this function.
-
mechanik20051988 authored
Previously we tried to bind to new URI and if it fails, we check the existence of inactive unix socket for same path and delete it. Now we first find and delete inactive unix socket with the same path and only then try to bind. Part of #3554
-
mechanik20051988 authored
Changed `calloc` function call to `xcalloc` function call. Made minor corrections in accordance with code style. Fix incorrect error message in `evio_service_bind` function.
-
mechanik20051988 authored
After stopping listening, the structure responsible for storing information about the listening socket (struct evio_service) was not initialized again, which led to the fact that it continued to store some outdated parameters. Closes #6535
-
mechanik20051988 authored
In iproto.cc and in coio.cc we raise diag in case when listen fails, but if errno == EADDRINUSE diag is not set, which leads to assertion. Also there is no reason to ignore EADDRINUSE for `listen` (for `bind` we check, that socket not used and if this is UNIX socket, we close it).
-
- Nov 16, 2021
-
-
Vladislav Shpilevoy authored
Follow-up #5568 @TarantoolBot document Title: box.info.ro_reason The new `box.info` field - `ro_reason` - is `nil` on a writable instance. On a read-only instance `box.info.ro == true` it reports an error reason. Currently the list is - `'election'` - `box.cfg.election_mode` is not `'off'` and this instance is not a leader. See `box.info.election` for details. - `'synchro'` - the synchro queue is owned by some other instance. For details see `box.info.synchro`. - `'config'` - `box.cfg.read_only` is true; - `'orphan'` - the instance is in orphan state.
-
Vladislav Shpilevoy authored
A previous commit added reason details as error fields. But error objects are serialized as strings by default thus loosing all the details. This commit makes ER_READONLY message contain the reason why it happened in a human-readable form. That way it will be well visible in the logs at least. Follow-up #5568
-
Vladislav Shpilevoy authored
ER_READONLY used not to have any details about the exact reason why the instance is read-only. The patch changes that by adding new fields into the error which explain why the error happened and even help to avoid it for next requests. Now from the error object can tell whether it was raised because of box.cfg.read_only = true, or the instance is an orphan, or it has election enabled but is not a leader, or the transaction limbo belongs to another instance. The alternative to ClientError alteration via error_payload was not to touch struct error and introduce a new error type specifically for ER_READONLY via a new C++ class like ReadOnlyError. But it had drawbacks: - There may be clients who expect ER_READONLY to have ClientError type. For instance, they check err.code == ER_READONLY only for err.type == 'ClientError'; - Having to introduce a new C++ class each time when want to add a new field into an error has to end. Rather sooner than later. Closes #5568 @TarantoolBot document Title: box.error.READONLY new attributes Users could see the error code as `box.error.READONLY` in `.code` field of an error object. The error didn't have any other attributes except common ones like 'type'. Now from the `box.error.READONLY` error users can see why it happened. The reasons can be the following: * The instance has `box.cfg.read_only = true`. Then the `READONLY` error has at least these fields: ``` tarantool> err:unpack() --- - reason: config code: 7 type: ClientError ... ``` * The instance is an orphan. It enters that state if number of connected replicas is < `box.cfg.replication_connect_quorum`. Then `READONLY` error has at least these fields: ``` tarantool> err:unpack() --- - reason: orphan code: 7 type: ClientError ... ``` * The synchro queue has an owner which is not the given instance. It usually happens if synchronous replication is used and there is another instance who called `box.ctl.promote()`. Then `READONLY` error has at least these fields: ``` tarantool> err:unpack() --- - queue_owner_id: <box.info.id of the queue owner> queue_owner_uuid: <box.info.uuid of the queue owner> reason: synchro term: <last known box.info.election.term of the owner> code: 7 type: ClientError ... ``` Note than `queue_owner_uuid` sometimes might be not present. * The instance has `box.cfg.election_mode` not `off` and it is not a leader. Then `READONLY` error has at least these fields: ``` tarantool> err:unpack() --- - state: <box.info.election.state of this instance> leader_id: <box.info.id of the leader> leader_uuid: <box.info.uuid of the leader> reason: election term: <box.info.election.term of this instance> code: 7 type: ClientError ... ``` `leader_id` and `leader_uuid` might be absent if the leader is not known. For example, an election is still in progress. Note, than `leader_uuid` sometimes might be not present even if `leader_id` is. If multiple reasons are true at the same time, then only one is returned in the following order of preference: election, synchro, config, orphan.
-
Vladislav Shpilevoy authored
-- Wait until the instance becomes an elected leader. server:wait_election_leader() -- Wait until an election leader is found. server:wait_election_leader_found() -- Get numeric ID of the instance like in box.info.id. server:instance_id() -- Get UUID of the instance like in box.info.uuid. server:instance_uuid() These are going to be used in a new test in a next commit.
-
Vladislav Shpilevoy authored
It takes box.cfg config as an argument. And changes the argument by adding a new key 'command'. If the caller wants to pass the same box.cfg or slightly modified to several build_server() calls, it won't work - all options will be the same on all instances. For example: local cfg = {...} cfg.replication = {url1} cluster:build_server(cfg) cfg.replication = {url2} cluster:build_server(cfg) It will not work. Both servers will get the same 'command' and the same 'replication'.
-
Vladislav Shpilevoy authored
In Lua struct error used RTTI to return members of the error depending on its type. If a field was added to error's payload, it wasn't visible. The patch makes Lua use error_payload instead of RTTI. Now if the payload gets a new field, it becomes automatically visible in Lua without need to introduce a new method for it. Part of #5568 Part of #4610 Part of #4907
-
Vladislav Shpilevoy authored
Before this patch mp_error API could only encode and decode hardcoded fields from the C++ classes inheriting struct error. The fields are gone from the classes in a previous patch - moved into error_payload. Now to be able to support arbitrary fields in the payload the MessagePack encoding/decoding must use its content instead of hardcoded fields depending on error type. Part of #5568 Part of #4610 Part of #4907
-
Vladislav Shpilevoy authored
error_payload is a part of struct error now. All the fields stored in C++ classes on top of struct error are moved into the payload. Part of #5568 Part of #4610 Part of #4907
-
Vladislav Shpilevoy authored
All optional fields soon will be moved into error_payload. Code was optional too. But it is needed too often, the most used field. The patch moves it into struct error to make it more accessible. Also in future it should allow to drop the hack ClientError::get_errcode() which tries to return error code depending on error type. But could just store the code right away. As a consequence of the patch, errors which didn't have an error code at all before, such as LuajitError, now have it 0 in Lua. Part of #5568 Part of #4610
-
Vladislav Shpilevoy authored
It is a dictionary-like struct which stores keys with binary data values. The values are supposed to be arbitrary MessagePack blobs: number, string, bool, UUID, array, map, anything. The payload is an array inside instead of a hash table because number of keys will be <= 3 in all cases. And even when it will be public, it is very unlikely it will be bigger. Object of error_payload in a future patch will be stored in struct error and will allow to extend it dynamically with more members. This in turn is needed to extend ER_READONLY error with more details about why it happened. Part of #5568 Part of #4907
-
Vladislav Shpilevoy authored
libuuid used to be a separate library since de11d68a ("CMake: refactor dependencies of internal libraries"). Unclear what was it done for. The commit says "fir unit tests". But they perfectly fine can depend on libcore like many of them do already. Because of libuuid being a separate library, libcore can't use tt_uuid, because that would be a cyclic dependency. And that won't allow to introduce tt_uuid-dependent API in a next patch. Hence libuuid is merged into libcore. Needed for #5568
-
Vladislav Shpilevoy authored
And from diag_add(). This will be helpful not to bother with box_error_last() and diag_last_error(diag_get()) in the future patch. It will change some attributes of a just created ER_READONLY error to add more details. Part of #5568
-
- Nov 15, 2021
-
-
Vladislav Shpilevoy authored
Watcher unit test linked with libbox and included core_test_utils.c. Both contain cord_on_yield() symbol. It is defined as a stub in core_test_utils and checks being inside of GC in libbox. Somehow it managed to link all this time just fine. And moreover the linker selected the correct symbol - the one from core_test_utils. But while making another patch (not submitted yet), some other unit test was changed a bit and the watcher unit test link stage started failing with 'cord_on_yield()' duplicate symbol. The patch drops core_test_utils from the test and makes it work with libbox correctly. To support that the test now needs to initialize the global Lua state.
-
Georgy Moiseev authored
Actualize changelog based on GitHub release pages changelogs. Some entries were skipped since they are not relevant to modern packages. Versions 1.8.1 and 2.0.4 changelogs were merged to 2.1.1 changelog. Closes #6397
-
Georgy Moiseev authored
Actualize changelog based on GitHub release pages changelogs. Some entries were skipped since they are not relevant to modern packages. Versions 1.8.1 and 2.0.4 changelogs were merged to 2.1.1 changelog. Part of #6397
-
Yaroslav Lobankov authored
This patch extends the 'integration.yml' workflow and adds a new workflow call for running tests to verify integration between tarantool and the expiration module. Part of #5265 Part of #6056 Closes #6528
-
- Nov 11, 2021
-
-
Vladimir Davydov authored
This commit fixes the following failure: ``` [028] --- wal_off/snapshot_stress.result Fri Jun 5 06:49:36 2020 [028] +++ wal_off/snapshot_stress.reject Fri Oct 16 13:48:23 2020 [028] @@ -375,7 +375,7 @@ [028] ... [028] snaps_find_status; [028] --- [028] -- snaps found [028] +- where are my snapshots? [028] ... [028] snapshot_check_failed = false [028] while #snaps > initial_snap_count do [028] ``` It happens, because the fiber making snapshots is started after worker fibers and it works until all worker fibers are done so it might occur that it doesn't make any snapshots. Fix this by replacing the while-loop with a repeat-loop, thus ensuring that the worker fiber makes at least one snapshot. Closes #5431
-
Vladimir Davydov authored
Just need to replace scoped guards with labels and add struct keyword to the sockaddr types. While we are at it, replace malloc with xmalloc in coio_fill_addrinfo - we don't check if the returned valued is NULL anyway.
-
Vladimir Davydov authored
There are just a few places outside coio.cc and coio_buf.h where these functions are used directly (most users use helpers from coio_buf.h or xrow_io.h): popen, console, applier. This is a step towards conversion of coio to C.
-
Vladimir Davydov authored
This commit makes coio_stat_stat_timeout, coio_waitpid, and coio_service_start exception-free. None of the functions is used anywhere in the code except for tests. This is a step towards conversion of coio to C.
-
Vladimir Davydov authored
Note, the only place where coio_connect is used is applier_connect, while coio_accept isn't used anywhere. This is needed to convert the net.box state machine to C.
-