From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id BD527441841 for ; Wed, 25 Mar 2020 04:43:09 +0300 (MSK) From: Nikita Pettik Date: Wed, 25 Mar 2020 04:42:56 +0300 Message-Id: Subject: [Tarantool-patches] [PATCH v2 00/10] Stacked diagnostics List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tarantool-patches@dev.tarantool.org Cc: v.shpilevoy@tarantool.org Branch: https://github.com/tarantool/tarantool/commits/np/gh-1148-stacked-diag Issue: https://github.com/tarantool/tarantool/issues/1148 https://github.com/tarantool/tarantool/issues/4778 Patch-set basically consists of two parts: first one fixes undocumented behaviour of box.error.new() which sets created error to diagnostics area. The reason why it is required is described in the corresponding github ticked. Second part is about stacked diagnostics itself: patch error structure extending it with double linked list, provide Lua and C interfaces to interact with it, support stacked diagnostics in IProto protocol and net.box module (all points according to the rfc: https://github.com/tarantool/tarantool/commit/1acd32d98f628431429b427df19caa9d269bb9c8). Changes in v2: - renamed 'prev' and 'next' links in struct error to 'cause' and 'effect'; - moved all tests related to box.error module to a separate file (box/error.test.lua); - removed recursion from error_unref(); - removed box_error_construct() and box_error_add() from public API; - removed error_prev() getter which was used to access error.prev member in Lua (now it is accessed directly via error._prev); - moved diag_add() usages to a separate commit; - several ref/unref usages corrections in the code; - added mp_check_* auxiliary checks to iproto_decode_error_stack(); - other minor refactoring (removing unused headers and redundant testing facilities, fixing comments etc); - rebased to fresh master branch. @ChangeLog * box.error.new() does not longer add created error to Tarantool's diagnostic area (gh-4778) * Introduced stacked diagnostick area: now each Lua table representing error object features .prev member and :set_prev() method. So that errors can be organized into lists. IProto protocol is extended with new command keys to support this feature as well (gh-1148). Kirill Shcherbatov (3): box: rfc for stacked diagnostic area box: rename diag_add_error to diag_set_error iproto: refactor error encoding with mpstream Nikita Pettik (7): test: move box.error tests to box/error.test.lua box/error: introduce box.error.set() method box/error: don't set error created via box.error.new to diag box: introduce stacked diagnostic area box: use stacked diagnostic area for functional indexes box/error: clarify purpose of reference counting in struct error iproto: support error stacked diagnostic area doc/rfc/1148-stacked-diagnostics.md | 225 ++++++++ extra/exports | 1 + src/box/applier.cc | 2 +- src/box/error.cc | 33 ++ src/box/error.h | 24 + src/box/iproto_constants.h | 6 + src/box/key_list.c | 16 +- src/box/lua/call.c | 6 +- src/box/lua/error.cc | 70 ++- src/box/lua/net_box.lua | 32 +- src/box/relay.cc | 4 +- src/box/vy_scheduler.c | 6 +- src/box/xrow.c | 158 +++++- src/lib/core/diag.c | 39 ++ src/lib/core/diag.h | 111 +++- src/lib/core/exception.cc | 3 +- src/lib/core/exception.h | 2 +- src/lua/error.c | 2 +- src/lua/error.h | 3 + src/lua/error.lua | 32 ++ src/lua/utils.c | 2 +- test/box-py/iproto.result | 6 +- test/box-py/iproto.test.py | 6 +- test/box/error.result | 791 ++++++++++++++++++++++++++++ test/box/error.test.lua | 216 ++++++++ test/box/iproto.result | 141 +++++ test/box/iproto.test.lua | 62 +++ test/box/misc.result | 423 --------------- test/box/misc.test.lua | 80 --- test/box/net.box.result | 60 +++ test/box/net.box.test.lua | 23 + test/engine/func_index.result | 50 +- test/engine/func_index.test.lua | 7 + 33 files changed, 2042 insertions(+), 600 deletions(-) create mode 100644 doc/rfc/1148-stacked-diagnostics.md create mode 100644 test/box/error.result create mode 100644 test/box/error.test.lua create mode 100644 test/box/iproto.result create mode 100644 test/box/iproto.test.lua -- 2.17.1