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 E9A5E6C1AE; Fri, 21 May 2021 00:38:22 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org E9A5E6C1AE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1621546703; bh=0rE6m4HhGRE6EtC7rIHPUQxPiqCOxE9nVs6a3mvEYqc=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=GVR+lYQ5gleWyVi8qe63HHqVqkOBL0JpZgYxh98hBVa6UGw+vUub4inI0sYN/Im7h q4+TEfz2WyUfSgVSoBKOi3xy0t5vscPaBdM80xZta6VpEL/IYvMrvHl8HZ3MN9imeK OjCeDe1qdReqcOMcd2IcvMHo8evGJiM4CQmOkNTA= Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com [209.85.208.179]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 6D97F6C1AE for ; Fri, 21 May 2021 00:38:22 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 6D97F6C1AE Received: by mail-lj1-f179.google.com with SMTP id c15so21579760ljr.7 for ; Thu, 20 May 2021 14:38:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=3h6zmIySOWmBp0ZaFZiriV2W3tzybDc17CcAVVUjU2I=; b=G315h4RpuFmgFYDunx76aU6SRZ+02Sj/YLlWpDhXH2DED1K8W8miK4NUQh1Oa/D1yy a1awjfaDIrt6dy2kTzkjQUowhCXR3u1BOLnUq0NbsWfvleB2/lBDuy7gP8tkSy61/LKS TWWjoKmMCXPwmug+AsIz2M8KHpxwJRUm+4HSVPOXxN++zBbPAgNTl01ax68tbPYY9pfD 1vcq57cDhYhBuZ+FVtuz56kHaoVz+h/MN69Tq/F2ib5Tbi853OrUxGayxF+UbW9cX6G2 1kb0J8eKH1hWzIERtZFGapNDq8cnyaKcJiWVcAbdb785frfoZeMLITpBePsiwdfVamQK R/gA== X-Gm-Message-State: AOAM533BKtnQVhEt+GRUh6dePaTGTp7kHuxd7jY2jtDtGu1Q/F4nsSZx kRa/QJxPprtKfZxjtT0QFZHJ4MmZ3/4= X-Google-Smtp-Source: ABdhPJyNLNrCm5/FKi+vt19OpJYeBQ5qhbFTjfoYyUTZjbjOoZSjT/CB4k3ZKHhPioJEkNm05sNffA== X-Received: by 2002:a2e:95cb:: with SMTP id y11mr4487976ljh.461.1621546701313; Thu, 20 May 2021 14:38:21 -0700 (PDT) Received: from grain.localdomain ([5.18.171.94]) by smtp.gmail.com with ESMTPSA id w5sm407661lfp.58.2021.05.20.14.38.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 May 2021 14:38:20 -0700 (PDT) Received: by grain.localdomain (Postfix, from userid 1000) id 8D92E5A003F; Fri, 21 May 2021 00:38:19 +0300 (MSK) To: tml Date: Fri, 21 May 2021 00:38:11 +0300 Message-Id: <20210520213812.50976-1-gorcunov@gmail.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [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: Cyrill Gorcunov via Tarantool-patches Reply-To: Cyrill Gorcunov Cc: Vladislav Shpilevoy Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" 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: -- 2.31.1