- Jun 23, 2019
-
-
Vladislav Shpilevoy authored
SWIM uses incarnation to refute old information, but it is not enough when restarts are possible. If an instance restarts, its incarnation is reset to 0. After several local and fast updates it gets N. But it is possible, that other instances also know incarnation of this instance as N, from its previous life, but with different information. They will never take new version of data, because their current version is also considered actual. As a result, incarnation is not enough. There was a necessity to create a persistent part of incarnation. This patch introduces it and calls 'generation'. As an additional profit, generation allows to react on instance restart in user defined triggers. Closes #4280 @TarantoolBot document Title: SWIM generation Incarnation now is a two-part value {generation, version}. Version is exactly the same that is called 'incarnation' in the original SWIM paper, and before this patch. It is a volatile automatically managed number to refute false gossips and update information on remote nodes. Generation is a new persistent part of incarnation allowing users to refute old pieces of information left from previous lifes of an instance. It is a static attribute set when a SWIM instance is created, and can't be changed without restarting the instance. A one could think of incarnation as 128 bit unsigned integer, where upper 64 bits are static and persistent, while lower 64 bits are volatile. Generation not only helps with overriding old information, but also can be used to detect restarts in user defined triggers, because it can be updated only when a SWIM instance is recreated. How to set generation: ```Lua swim = require('swim') s = swim.new({generation = <value>}) ``` Generation can't be set in `swim:cfg`. If it is omitted, then 0 is used by default. But be careful - if the instance is started not a first time, it is safer to use a new generation. Ideally it should be persisted somehow: in a file, in a space, in a global service. Each next `swim.new()` should take incremented value of generation. How is incarnation update changed: ```Lua swim = require('swim') s = swim.new() s:on_member_event(function(m, e) if e:is_new_incarnation() then if e:is_new_generation() then -- Process restart. end if e:is_new_version() then -- Process version update. It means -- the member is somehow changed. end end end) ``` Note, `is_new_incarnation` is now a shortcut for checking update of generation, or version, or both. Method `member:incarnation()` is changed. Now it returns cdata object with attributes `version` and `generation`. Usage: ```Lua incarnation = member:incarnation() tarantool> incarnation.version --- - 15 ... tarantool> incarnation.generation --- - 2 ... ``` These objects can be compared using comparison operators: ```Lua member1:incarnation() < member2:incarnation member1:incarnation() >= member2:incarnation() -- Any operator works: ==, <, >, <=, >=, ~=. ``` Being printed, incarnation shows a string with both generation and incarnation. Binary protocol is updated. Now Protocol Logic section looks like this: ``` +-------------------Protocol logic section--------------------+ | map { | | 0 = SWIM_SRC_UUID: 16 byte UUID, | | | | AND | | | | 2 = SWIM_FAILURE_DETECTION: map { | | 0 = SWIM_FD_MSG_TYPE: uint, enum swim_fd_msg_type, | | 1 = SWIM_FD_GENERATION: uint, | | 2 = SWIM_FD_VERSION: uint | | }, | | | | OR/AND | | | | 3 = SWIM_DISSEMINATION: array [ | | map { | | 0 = SWIM_MEMBER_STATUS: uint, | | enum member_status, | | 1 = SWIM_MEMBER_ADDRESS: uint, ip, | | 2 = SWIM_MEMBER_PORT: uint, port, | | 3 = SWIM_MEMBER_UUID: 16 byte UUID, | | 4 = SWIM_MEMBER_GENERATION: uint, | | 5 = SWIM_MEMBER_VERSION: uint, | | 6 = SWIM_MEMBER_PAYLOAD: bin | | }, | | ... | | ], | | | | OR/AND | | | | 1 = SWIM_ANTI_ENTROPY: array [ | | map { | | 0 = SWIM_MEMBER_STATUS: uint, | | enum member_status, | | 1 = SWIM_MEMBER_ADDRESS: uint, ip, | | 2 = SWIM_MEMBER_PORT: uint, port, | | 3 = SWIM_MEMBER_UUID: 16 byte UUID, | | 4 = SWIM_MEMBER_GENERATION: uint, | | 5 = SWIM_MEMBER_VERSION: uint, | | 6 = SWIM_MEMBER_PAYLOAD: bin | | }, | | ... | | ], | | | | OR/AND | | | | 4 = SWIM_QUIT: map { | | 0 = SWIM_QUIT_GENERATION: uint, | | 1 = SWIM_QUIT_VERSION: uint | | } | | } | +-------------------------------------------------------------+ ``` Note - SWIM_FD_INCARNATION, SWIM_MEMBER_INCARNATION, and SWIM_QUIT_INCARNATION disappeared. Incarnation is sent now in two parts: version and generation. SWIM_MEMBER_PAYLOAD got a new value. This changes are legal because 1) the SWIM is not released yet, so it is mutable, 2) I wanted to emphasize that 'generation' is first/upper part of incarnation, 'version' is second/lower part.
-
Vladislav Shpilevoy authored
Traditional SWIM describes member version as incarnation - volatile monotonically growing number to refute false gossips. But it is not enough in the real world because of necessity to detect restarts and refute information from previous lifes of an instance. Incarnation is going to be a two-part value with persistent upper part and volatile lower part. This patch does preparations making incarnation struct instead of a number. Volatile part is called 'version. Part of #4280
-
- Jun 21, 2019
-
-
Serge Petrenko authored
The const qualifiers weren't there initially for some reason. Fix this. Part of #692
-
Serge Petrenko authored
The ability to encode/decode ext types is added to msgpuck. These types will be used for decimal encoding/decoding in tarantool. Needed for #692
-
Mergen Imeev authored
This patch creates tuple_formats for the tuples obtained through the netbox. Closes #2978 @TarantoolBot document Title: Field names for tuples received from net.box It is possible now to access by field name for tuples received from net.box. For example: box.cfg{listen = 3302} box.schema.user.grant('guest','read, write, execute', 'space') box.schema.user.grant('guest', 'create', 'space') box.schema.create_space("named", {format = {{name = "id"}}}) box.space.named:create_index('id', {parts = {{1, 'unsigned'}}}) box.space.named:insert({1}) require('net.box').connect('localhost', 3302).space.named:get(1).id Result: tarantool> require('net.box').connect('localhost', 3302).space.named:get(1).id --- - 1 ...
-
Mergen Imeev authored
This patch defines a new function that parses space format and returns it to Lua as cdata. For this cdata destructor is included. Needed for #2978
-
Mergen Imeev authored
This patch changes the way arguments are passed to functions in the array method_encoder, and saves these arguments in REQUEST. This is necessary to establish a connection between netbox space objects and the tuples obtained through the netbox Needed for #2978
-
- Jun 20, 2019
-
-
Vladislav Shpilevoy authored
-
Mergen Imeev authored
This function is useless in Tarantool and should be removed.
-
Nikita Pettik authored
Function tarantoolsqlEphemeralDrop() always returns 0. Let's make it return void to make code clean.
-
Nikita Pettik authored
Follow-up for #4074
-
Mergen Imeev authored
This function is not used in Tarantool and should be removed.
-
Mergen Imeev authored
Currently, the rc field of the VDBE structure is either 0 or -1. Due to this, it is better to replace this integer field with the boolean field is_aborted.
-
Mergen Imeev authored
This field has become unused and should be removed.
-
Mergen Imeev authored
Removing this error code is part of getting rid of the SQL error system.
-
Mergen Imeev authored
Removing this error code is part of getting rid of the SQL error system.
-
Mergen Imeev authored
Removing this error code is part of getting rid of the SQL error system.
-
Mergen Imeev authored
Removing this error code is part of getting rid of the SQL error system.
-
Mergen Imeev authored
Removing this error code is part of getting rid of the SQL error system.
-
Mergen Imeev authored
Removing this error code is part of getting rid of the SQL error system.
-
Mergen Imeev authored
Removing this error code is part of getting rid of the SQL error system.
-
Mergen Imeev authored
Removing this error code is part of getting rid of the SQL error system.
-
Mergen Imeev authored
Removing this error code is part of getting rid of the SQL error system.
-
Mergen Imeev authored
Removing this error code is part of getting rid of the SQL error system.
-
Mergen Imeev authored
Removing this error code is part of getting rid of the SQL error system.
-
Mergen Imeev authored
Removing this error code is part of getting rid of the SQL error system.
-
Mergen Imeev authored
Removing this error/status code is part of getting rid of the SQL error system.
-
Mergen Imeev authored
Removing this error code is part of getting rid of the SQL error system.
-
Mergen Imeev authored
Removing these error codes is part of getting rid of the SQL error system.
-
Mergen Imeev authored
Removing this error/status code is part of getting rid of the SQL error system.
-
Mergen Imeev authored
Since the lookaside system is not currently in use, it must be completely removed.
-
Mergen Imeev authored
These functions are not currently used and should be removed.
-
Mergen Imeev authored
These functions are part of the SQL error system, which is replaced by the Tarantool error system. They are not needed now, so they will be deleted.
-
Mergen Imeev authored
This field has become unused and should be removed.
-
Mergen Imeev authored
This field has become unused and should be removed.
-
Mergen Imeev authored
This field has become unused and should be removed.
-
Georgy Kirichenko authored
Get rid of duplicated fiber on stop logic. Prerequisites: #1254
-
Vladimir Davydov authored
To apply replicated rows in parallel, we need to be able to complete transactions asynchronously, from the tx_prio callback. We can't yield there so we must ensure that on_commit/on_rollback triggers don't yield. The only place where we may yield in a completion trigger is vinyl DDL, which submits vylog records and waits for them to complete. Actually, there's no reason to wait for vylog write to complete, as we can handle missing records on recovery. So this patch reworks vylog to make vy_log_tx_try_commit() and hence on_commit/on_rollback triggers using it non-yielding. To achieve that, we need to: - Use vy_log.latch only to sync log rotation vs writes. Don't protect vylog buffer with it. This makes vy_log_tx_begin() non-yielding. - Use a separate list and buffer for storing vylog records of each transaction. We used to share them among transactions, but without vy_log.latch we can't sync access to them anymore. Since vylog transactions are rare events, this should be fine. - Make vy_log_tx_try_commit() append the transaction to the list of pending transactions and wake up a background fiber to flush all pending transactions. This way it doesn't need to yield. Closes #4218
-
Maria Khaydich authored
Receive function behaved inconsistently for the cases where first we use an integer as a pattern as to tell the function a specific number of elements we want to read, and then perform another receive call using '*a' as a pattern. The latter should have denoted that we want to get all there is to get, but instead it was possible to get only a part of data and also in non-sequential order. Closes #4118
-
- Jun 19, 2019
-
-
Vladislav Shpilevoy authored
URI reconfiguration causes incarnation increment in order to forcefully rewrite old value on remote instances. But that update was not delivered to a user via triggers. The patch fixes that.
-