Skip to content

Drop net.box.self.call() usage on storage #641

Draft
Serpentian wants to merge 2 commits into
tarantool:masterfrom
Serpentian:test-perf-bump
Draft

Drop net.box.self.call() usage on storage #641
Serpentian wants to merge 2 commits into
tarantool:masterfrom
Serpentian:test-perf-bump

Conversation

@Serpentian
Copy link
Copy Markdown
Collaborator

@Serpentian Serpentian commented Feb 6, 2026

This code breaks backward compatibility of vshard.storage.call, but who cares, if it gives 10% perf boost. Let's check that...

@Serpentian Serpentian self-assigned this Feb 6, 2026
kamenkremen and others added 2 commits February 6, 2026 17:55
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
@Serpentian Serpentian changed the title wip: test that tests works with the following code Drop net.box.self.call() usage on storage Feb 6, 2026
Comment thread vshard/storage/init.lua
Comment on lines +287 to +289
return handle_results(pcall(func, obj, unpack(args)))
else
return handle_results(pcall(func, unpack(args)))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tarantool> unpack({1, nil, 3})
---
- 1
Suggested change
return handle_results(pcall(func, obj, unpack(args)))
else
return handle_results(pcall(func, unpack(args)))
return handle_results(pcall(func, obj, unpack(args, 1, table.maxn(args))))
else
return handle_results(pcall(func, unpack(args, 1, table.maxn(args))))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants