Tarantool development patches archive
 help / color / mirror / Atom feed
From: Serge Petrenko <sergepetrenko@tarantool.org>
To: v.shpilevoy@tarantool.org, gorcunov@gmail.com, sergos@tarantool.org
Cc: tarantool-patches@dev.tarantool.org
Subject: [Tarantool-patches] [RAFT 03/10] [tosquash] raft: return raft_request to xrow
Date: Wed, 26 Aug 2020 10:52:35 +0300	[thread overview]
Message-ID: <cc940b580bc41036190324c1e6c2f009a5cf5e85.1598427905.git.sergepetrenko@tarantool.org> (raw)
In-Reply-To: <cover.1598427905.git.sergepetrenko@tarantool.org>

From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>

Xrow is the owner of all the IProto and xlog codecs. So the
raft reaquest's definition belongs here, just like any other
request.
---
 src/box/raft.c | 1 -
 src/box/raft.h | 9 +--------
 src/box/xrow.c | 1 -
 src/box/xrow.h | 7 ++++++-
 4 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/src/box/raft.c b/src/box/raft.c
index 839a7dfeb..227846596 100644
--- a/src/box/raft.c
+++ b/src/box/raft.c
@@ -32,7 +32,6 @@
 
 #include "error.h"
 #include "journal.h"
-#include "xrow.h"
 #include "small/region.h"
 #include "replication.h"
 #include "relay.h"
diff --git a/src/box/raft.h b/src/box/raft.h
index 9cb39dd24..b11ae7b1d 100644
--- a/src/box/raft.h
+++ b/src/box/raft.h
@@ -29,7 +29,7 @@
  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  */
-#include <stdint.h>
+#include "xrow.h"
 #include "cbus.h"
 
 #if defined(__cplusplus)
@@ -52,13 +52,6 @@ struct raft {
 
 extern struct raft raft;
 
-struct raft_request {
-	uint64_t term;
-	uint32_t vote;
-	enum raft_state state;
-	struct vclock *vclock;
-};
-
 struct raft_broadcast_msg {
 	struct cmsg base;
 	struct raft_request req;
diff --git a/src/box/xrow.c b/src/box/xrow.c
index f60b12cfc..ed3f77a15 100644
--- a/src/box/xrow.c
+++ b/src/box/xrow.c
@@ -44,7 +44,6 @@
 #include "scramble.h"
 #include "iproto_constants.h"
 #include "mpstream/mpstream.h"
-#include "raft.h"
 
 static_assert(IPROTO_DATA < 0x7f && IPROTO_METADATA < 0x7f &&
 	      IPROTO_SQL_INFO < 0x7f, "encoded IPROTO_BODY keys must fit into "\
diff --git a/src/box/xrow.h b/src/box/xrow.h
index 3f37dc18f..5d571a821 100644
--- a/src/box/xrow.h
+++ b/src/box/xrow.h
@@ -264,7 +264,12 @@ xrow_encode_synchro(struct xrow_header *row,
 int
 xrow_decode_synchro(const struct xrow_header *row, struct synchro_request *req);
 
-struct raft_request;
+struct raft_request {
+	uint64_t term;
+	uint32_t vote;
+	uint32_t state;
+	struct vclock *vclock;
+};
 
 int
 xrow_encode_raft(struct xrow_header *row, struct region *region,
-- 
2.20.1 (Apple Git-117)

  parent reply	other threads:[~2020-08-26  7:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-26  7:52 [Tarantool-patches] [RAFT 00/10] raft implementation Serge Petrenko
2020-08-26  7:52 ` [Tarantool-patches] [RAFT 01/10] raft: introduce persistent raft state Serge Petrenko
2020-08-26  7:52 ` [Tarantool-patches] [RAFT 02/10] raft: relay status updates to followers Serge Petrenko
2020-08-27 20:36   ` Vladislav Shpilevoy
2020-08-28 10:10     ` Sergey Petrenko
2020-08-26  7:52 ` Serge Petrenko [this message]
2020-08-26  7:52 ` [Tarantool-patches] [RAFT 04/10] [tosquash] raft: introduce IPROTO_RAFT_VCLOCK Serge Petrenko
2020-08-26  7:52 ` [Tarantool-patches] [RAFT 05/10] [tosquash] xrow: refactor raft request codec Serge Petrenko
2020-08-26  7:52 ` [Tarantool-patches] [RAFT 06/10] [tosquash] raft: don't fill raft_request manually Serge Petrenko
2020-08-26  7:52 ` [Tarantool-patches] [RAFT 07/10] [tosquash] raft: rename curr_leader to leader Serge Petrenko
2020-08-26  7:52 ` [Tarantool-patches] [RAFT 08/10] [tosquash] raft: rename raft_process to raft_process_recovery Serge Petrenko
2020-08-26  7:52 ` [Tarantool-patches] [RAFT 09/10] [tosquash] applier: handler error at raft row appliance Serge Petrenko
2020-08-26  7:53 ` [Tarantool-patches] [RAFT 10/10] [tosquash] relay: move raft broadcast details into relay Serge Petrenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cc940b580bc41036190324c1e6c2f009a5cf5e85.1598427905.git.sergepetrenko@tarantool.org \
    --to=sergepetrenko@tarantool.org \
    --cc=gorcunov@gmail.com \
    --cc=sergos@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [RAFT 03/10] [tosquash] raft: return raft_request to xrow' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox