From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 374417030C; Mon, 24 May 2021 11:47:29 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 374417030C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1621846049; bh=reKENl53HrGNVd16ivTbfGywH3/XjVwG1v7H2pRwd9w=; h=To:References:Date:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=RuO6HinRtarGFmk6JK/NWrE0JpPJrTqdfEyK41RJukcpJqKIxjjuWAfWo3AjR6n4K G0LLmXd3q3g7ua2gK49GLPnXHuWfpEzNwh7jkgKRYLDSDHxW/bMaI21ReWBOQcSXmB grVsqf240ACQkECLGijtBzamX2VHaxFowXb3XgRM= Received: from smtp55.i.mail.ru (smtp55.i.mail.ru [217.69.128.35]) (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 DBE007030C for ; Mon, 24 May 2021 11:47:27 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org DBE007030C Received: by smtp55.i.mail.ru with esmtpa (envelope-from ) id 1ll6FC-00032m-JB; Mon, 24 May 2021 11:47:27 +0300 To: Cyrill Gorcunov , tml References: <20210520213812.50976-1-gorcunov@gmail.com> Message-ID: <8365e6fc-7304-5e3b-31ef-28200b583a83@tarantool.org> Date: Mon, 24 May 2021 11:47:26 +0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: <20210520213812.50976-1-gorcunov@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD91B019B01C53E51AF9418A6087D01078917D63D7C0371164600894C459B0CD1B9B422DB3B358CDD276C27B4744FC2EE9CFF29E58B60795CEFA39B5B018D1B5ADE X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7AD2F2D6F6013FF7FC2099A533E45F2D0395957E7521B51C2CFCAF695D4D8E9FCEA1F7E6F0F101C6778DA827A17800CE7A33E1178EA603666EA1F7E6F0F101C6723150C8DA25C47586E58E00D9D99D84E1BDDB23E98D2D38BD6CF32B5F8F9D404E8AC838E0871C6BF8E950D2D4F1582BFCC7F00164DA146DAFE8445B8C89999728AA50765F790063783E00425F71A4181389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC8EDCF5861DED71B2F389733CBF5DBD5E9B5C8C57E37DE458BD9DD9810294C998ED8FC6C240DEA76428AA50765F7900637C0E5111DF1811ACFD32BA5DBAC0009BE395957E7521B51C20BC6067A898B09E4090A508E0FED6299176DF2183F8FC7C0ABD590C9C6A374A6CD04E86FAF290E2D7E9C4E3C761E06A71DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B67A7B0CDC955A1711089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: 0D63561A33F958A5F1C4EAFC50E1E82A5000C0662687BC9243A725CF3383FBDAD59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA753C350047980234DB410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D344F2126FF337FA6518C65D6ABF163C132F737805EF180151A097646A55B1F1DB95B9A499DD38023D01D7E09C32AA3244CA8BC660894B1023B1E295F98307744FF795D98D676DD64D0927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj+gjVyQcIK6K1iy0BthSKCA== X-Mailru-Sender: 583F1D7ACE8F49BD95918038521BA2AA589A3EE3EB8FF7B11842F5B8F9490430E02BBB4920CF2F6C424AE0EB1F3D1D21E2978F233C3FAE6EE63DB1732555E4A8EE80603BA4A5B0BC112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH] iproto: stringify IPROTO_RAFT, IPROTO_PROMOTE X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Serge Petrenko via Tarantool-patches Reply-To: Serge Petrenko Cc: Vladislav Shpilevoy Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" 21.05.2021 00:38, Cyrill Gorcunov пишет: > This allows `xlog` Lua module to decode appropriate > types into symbolic form. > > For example with the patch we should see raft and > promote types in output. > > | $ tarantoolctl cat 00000000000000000004.xlog > | --- > | HEADER: > | lsn: 2 > | group_id: 1 > | type: RAFT > | timestamp: 1621541912.4588 > | BODY: > | 0: 3 > | 1: 4 > | --- > | HEADER: > | lsn: 1 > | replica_id: 4 > | type: PROMOTE > | timestamp: 1621541912.4592 > | BODY: > | 2: 0 > | 3: 0 > | 83: 3 > > Fixes #6088 > > Signed-off-by: Cyrill Gorcunov > --- > .../unreleased/gh-6088-xlog-raft-lua.mg | 19 +++++++++++++++++++ > src/box/iproto_constants.h | 4 ++++ > 2 files changed, 23 insertions(+) > create mode 100644 changelogs/unreleased/gh-6088-xlog-raft-lua.mg > > diff --git a/changelogs/unreleased/gh-6088-xlog-raft-lua.mg b/changelogs/unreleased/gh-6088-xlog-raft-lua.mg > new file mode 100644 > index 000000000..767cfbd07 > --- /dev/null > +++ b/changelogs/unreleased/gh-6088-xlog-raft-lua.mg > @@ -0,0 +1,19 @@ > +## bugfix/core > + * Added decoding of election messages: `RAFT` and `PROMOTE` to > + `xlog` Lua module (gh-6088). Otherwise `tarantoolctl` shows > + plain number in `type` > + ``` > + HEADER: > + lsn: 1 > + replica_id: 4 > + type: 31 > + timestamp: 1621541912.4592 > + ``` > + instead of symbolic representation > + ``` > + HEADER: > + lsn: 1 > + replica_id: 4 > + type: PROMOTE > + timestamp: 1621541912.4592 > + ``` > diff --git a/src/box/iproto_constants.h b/src/box/iproto_constants.h > index 99c8ca184..7362ddaf1 100644 > --- a/src/box/iproto_constants.h > +++ b/src/box/iproto_constants.h > @@ -305,6 +305,10 @@ iproto_type_name(uint16_t type) > return iproto_type_strs[type]; > > switch (type) { > + case IPROTO_RAFT: > + return "RAFT"; > + case IPROTO_PROMOTE: > + return "PROMOTE"; > case IPROTO_CONFIRM: > return "CONFIRM"; > case IPROTO_ROLLBACK: Thanks for the patch! LGTM. -- Serge Petrenko