Branch: refs/heads/master
Home: https://github.com/mailru/tarantool
Commit: fafa3465549b0d0c0f963f0b5060409b06fdd420
https://github.com/mailru/tarantool/commit/fafa3465549b0d0c0f963f0b5060409b06fdd420
Author: Konstantin Osipov <[email protected]>
Date: 2013-02-09 (Sat, 09 Feb 2013)
Changed paths:
M include/iobuf.h
M src/iobuf.m
M src/iproto.m
Log Message:
-----------
Fix two bugs in the new async I/O.
There were two cases when the new async I/O worked incorrectly.
The problems only revealed themselves under specific
concurrency circumstances.
In one case, the client would get a mix of pieces of different
packets (responses).
The reason for this was that, when selecting which output buffer
to write to the client, the flushing algorithm used to select
whichever of two buffers, associated with a session, had data to
flush.
This worked OK as long as the entire contents of the buffer could
be written in one writev() call. But when writev() would only be
able to write a part of the buffer, the next writev() could
already be done with another buffer, thus producing a mix of
*partial* writes from both buffers.
Between two buffers used for a session, one is always newer than
the other (contains responses to requests which came in earlier).
So basically the bug was that we would select a newer
buffer for flushing, while there were still unhandled requests
in the older buffer.
One approach to a fix would be to, once started, keep writing
the newer buffer until there is nothing to write in it.
The actual fix chooses a simpler approach: to never begin
with a newer buffer, until the older one is completely written.
Thus, there is never reordering of output between two
output buffers, only within a single buffer.
The second bug was caused by wrong calculation of write offset
for iproto header. When iproto_header would fall on the
border of two iov vectors, obuf_book would rightfully
discard the tail of the first iov vector, and "position"
the header at the beginning of the second vector.
However, the savepoint used to memcpy() the output would
still point at the first vector, and the header would be
(partially) written at the end of the first vector,
not at the beginning of of the second.
This led to a) write beyond allocated memory b) loss
of a piece of a packet (effect seen by the client).
The fix is to correctly record the write position when
making a booking. obuf_book signature is changed
respectively.
No test cases since the bug is only spottable under certain
concurrency circumstances (a single CPU box, client/server I/O).
@todo: add unit tests.
Commit: 152e3e00cd2d9a5ea1d7c1fc45584a502b2aa9ec
https://github.com/mailru/tarantool/commit/152e3e00cd2d9a5ea1d7c1fc45584a502b2aa9ec
Author: Konstantin Osipov <[email protected]>
Date: 2013-02-09 (Sat, 09 Feb 2013)
Changed paths:
M doc/user/stored-procedures.xml
M src/box/box.lua
M src/box/box_lua.m
M src/box/index.m
M test/big/lua.result
M test/big/lua.test
M test/big/tarantool.cfg
M test/box/lua.result
M test/box/lua.test
Log Message:
-----------
Merge branch 'stable' of github.com:mailru/tarantool into stable
Commit: 982801e1eda8fc73b23a0b714a073ee7f82d4dfc
https://github.com/mailru/tarantool/commit/982801e1eda8fc73b23a0b714a073ee7f82d4dfc
Author: Konstantin Osipov <[email protected]>
Date: 2013-02-09 (Sat, 09 Feb 2013)
Changed paths:
M include/iobuf.h
M src/iobuf.m
M src/iproto.m
Log Message:
-----------
Merge branch 'stable'
Compare: https://github.com/mailru/tarantool/compare/bd76ca4e91c3...982801e1eda8
_______________________________________________
Mailing list: https://launchpad.net/~tarantool-developers
Post to : [email protected]
Unsubscribe : https://launchpad.net/~tarantool-developers
More help : https://help.launchpad.net/ListHelp