storage: preserve original error on function fail#629
storage: preserve original error on function fail#629Gerold103 merged 1 commit intotarantool:masterfrom
Conversation
949d8a9 to
80bd895
Compare
Serpentian
left a comment
There was a problem hiding this comment.
Almost there! Well done
Serpentian
left a comment
There was a problem hiding this comment.
Thank you for the patches! Well done
|
I ran some performance tests, and here are the results. SetupHardware Intel(R) Xeon(R) Gold 6230 CPU @ 2.10GHzTarantool Tarantool 2.11.0-0-g247a9a4183
Target: Linux-x86_64-Release
Build options: cmake . -DCMAKE_INSTALL_PREFIX=/usr/local -DENABLE_BACKTRACE=TRUE
Compiler: GNU-8.3.1
C_FLAGS: -fexceptions -funwind-tables -fasynchronous-unwind-tables -fno-common -fopenmp -msse2 -Wformat -Wformat-security -Werror=format-security -fstack-protector-strong -fPIC -fmacro-prefix-map=./tarantool=. -std=c11 -Wall -Wextra -Wno-gnu-alignof-expression -fno-gnu89-inline -Wno-cast-function-type
CXX_FLAGS: -fexceptions -funwind-tables -fasynchronous-unwind-tables -fno-common -fopenmp -msse2 -Wformat -Wformat-security -Werror=format-security -fstack-protector-strong -fPIC -fmacro-prefix-map=./tarantool=. -std=c++11 -Wall -Wextra -Wno-invalid-offsetof -Wno-gnu-alignof-expression -Wno-cast-function-type2 shards, 2 replicas in one shard, 9 routers, 9 load generators, which are created as follows: tarantool generate_load.lua \
--bucket_count 30000 \
--op_type replace \
--warmup \
--uri localhost:3305,localhost:3306,localhost:3307,localhost:3308,localhost:3309,localhost:3310,localhost:3311,localhost:3312,localhost:3313 \
--fibers 50 \
--ops 1000000 \Mean of 20 iterations The perf test is from https://github.com/tarantool/vshard-ee/pull/51, with registered replace function in schema.
|
|
Let's do only that variant:
The perf degradation is way too huge in the second variant. We'll leave #630 unresolved for now, since nobody complained about that yet. |
ee34ee2 to
4c6abe1
Compare
mrForza
left a comment
There was a problem hiding this comment.
Thank you for the clean patch! 👍 Left some minor comments below
|
I can confirm, that @kamenkremen commit doesn't cause major perf degradation, so I remove However, @Gerold103, can we go even further and drop that piece of shit from net.box, which we don't need at all: local results = {...}
for i = 1, select('#', ...) do
if type(results[i]) == 'cdata' then
results[i] = msgpack.decode(msgpack.encode(results[i]))
end
end
return unpack(results)This breaks backward compatibility of 5 workers (load generators), 9 routers, 2 shards, 2 replicas in one shard. replaces. Before the patches: After Ivan`s commit: After two commits (Ivan's + Mine: #641): EditActually, we must fix it in core: tarantool/tarantool#11624 (comment). The inconsistency between versions is much more serious: the return type on router becomes This way we have the following backward compatibility breakage: when cdata is returned on old vshard versions, vshard automatically did table from it, from now on cdata itself is returned. IMHO, it's ok. |
In Tarantool versions prior to 3.0.0-beta1-18, `net_box.self.call()` cannot invoke C stored or Lua persistent functions. Therefore, if such a function is registered in `box.func`, vshard executes it via `func.call` instead. If such a function raises an error during an uncommitted transaction, 'Transaction is active...' error is going to be raised, which will mask the original error. This patch fixes that bug by checking the function call result. If the function returns an error and a transaction is still active, vshard now explicitly rolls back the transaction. Fixes tarantool#614 NO_DOC=bugfix
|
I think it is fine to just drop |
Gerold103
left a comment
There was a problem hiding this comment.
Thanks, this was a tricky topic in terms of perf and tiny details of behaviour.
mrForza
left a comment
There was a problem hiding this comment.
Thank you for the patch!
For older Tarantool versions vshard uses func.call to execute functions.
If such a function raises an error during an uncommitted transaction, 'Transaction is active...' error is going to be raised, which will mask the original error.
This patch fixes that bug by checking the function call result. If the function returns an error and a transaction is still active, vshard now explicitly rolls back the transaction.
Fixes #614
NO_DOC=bugfix