iproto: implement interactive transactions over iproto streams
Implement interactive transactions over iproto streams. Each stream can start its own transaction, so they allows multiplexing several transactions over one connection. If any request fails during the transaction, it will not affect the other requests in the transaction. If disconnect occurs when there is some active transaction in stream, this transaction will be rollbacked, if it does not have time to commit before this moment. Part of #5860 @TarantoolBot document Title: interactive transactions was implemented over iproto streams. The main purpose of streams is transactions via iproto. Each stream can start its own transaction, so they allows multiplexing several transactions over one connection. There are multiple ways to begin, commit and rollback transaction: using IPROTO_CALL and IPROTO_EVAL with corresponding function (box.begin, box.commit and box.rollback), IPROTO_EXECUTE with corresponding sql request ('TRANSACTION START', 'COMMIT', 'ROLLBACK') and IPROTO_BEGIN, IPROTO_COMMIT, IPROTO_ROLLBACK accordingly. If disconnect occurs when there is some active transaction in stream, this transaction will be rollbacked, if it does not have time to commit before this moment. Add new command codes for begin, commit and rollback transactions: `IPROTO_BEGIN 14`, `IPROTO_COMMIT 15` and `IPROTO_ROLLBACK 16` accordingly.
Showing
- src/box/call.c 0 additions, 12 deletionssrc/box/call.c
- src/box/errcode.h 1 addition, 0 deletionssrc/box/errcode.h
- src/box/iproto.cc 253 additions, 3 deletionssrc/box/iproto.cc
- src/box/iproto_constants.c 6 additions, 0 deletionssrc/box/iproto_constants.c
- src/box/iproto_constants.h 6 additions, 0 deletionssrc/box/iproto_constants.h
- src/box/txn.c 23 additions, 0 deletionssrc/box/txn.c
- src/box/txn.h 19 additions, 0 deletionssrc/box/txn.h
- test/box-tap/feedback_daemon.test.lua 1 addition, 1 deletiontest/box-tap/feedback_daemon.test.lua
- test/box/error.result 1 addition, 0 deletionstest/box/error.result
- test/box/misc.result 4 additions, 1 deletiontest/box/misc.result
Loading
Please register or sign in to comment