Skip to content
Snippets Groups Projects
Commit ccd61773 authored by Konstantin Osipov's avatar Konstantin Osipov
Browse files

Lua: prepare to intercept box.process results into Lua.

Remove dead code from txn_cleanup(), which
would check that txn_cleanup() is not called twice:
this code is from the time when we used

Rename txn_abort() to txn_rollback().
Rename txn_alloc() to txn_begin().

Introduce box_out interface, used to
send box results to the client. Lua uses
this interface to intercept returned tuples
and push as return values to Lua stack.

Make iov_add/iov_dup inline, as they used
to be. They are now mostly used from within
callbacks.

Make txn_commit()/txn_rollback() non-static
as they are now used in memcached.m.

Introduce memcached_get(): implementation
of Memcached GET statement. Wrap memcached_get()
in proper txn_begin()/txn_commit()/txn_rollback(),
and handle failure of memcached_get() by
rolling back the transaction.
Split BOX_QUIET to two flags: BOX_GC_TXN and
BOX_QUIET.
BOX_QUIET had a side-effect that txn_cleanup()
was done immediately, rather than by fiber_gc().
This had the side effect that txn_commit() could
not be used in memcached_get(), because in
memcached_get() we need both BOX_QUIET and txn_cleanup()
called from fiber_gc().

Now that we have box_out interface, eliminate
BOX_QUIET flag completely, and use box_out_quiet
set of callbacks instead.
parent dc334a0c
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment