[tarantool-patches] [PATCH v2 1/3] Applier gets rid of a xstream

Vladimir Davydov vdavydov.dev at gmail.com
Thu Mar 7 12:31:04 MSK 2019


On Wed, Mar 06, 2019 at 11:16:15PM +0300, Georgy Kirichenko wrote:
> Remove xstream dependency and use direct box interface to apply all
> replication rows. This is refactoring before transactional replication.
> 
> Needed for: #2798
> ---
>  src/box/applier.cc | 69 ++++++++++++++++++++++++++++++++++++++--------
>  src/box/applier.h  |  9 +-----
>  src/box/box.cc     | 68 ++++++++-------------------------------------
>  3 files changed, 69 insertions(+), 77 deletions(-)

Pushed to 2.1 with the following minor changes:

diff --git a/src/box/applier.cc b/src/box/applier.cc
index a687d2be..94c07aac 100644
--- a/src/box/applier.cc
+++ b/src/box/applier.cc
@@ -201,11 +201,8 @@ apply_row(struct xrow_header *row)
 	struct request request;
 	if (xrow_decode_dml(row, &request, dml_request_key_map(row->type)) != 0)
 		return -1;
-	if (request.type == IPROTO_NOP) {
-		if (process_nop(&request) != 0)
-			return -1;
-		return 0;
-	}
+	if (request.type == IPROTO_NOP)
+		return process_nop(&request);
 	struct space *space = space_cache_find(request.space_id);
 	if (space == NULL)
 		return -1;
diff --git a/src/box/box.cc b/src/box/box.cc
index 45beefb9..f7ce33aa 100644
--- a/src/box/box.cc
+++ b/src/box/box.cc
@@ -307,9 +307,9 @@ apply_wal_row(struct xstream *stream, struct xrow_header *row)
 	struct wal_stream *xstream =
 		container_of(stream, struct wal_stream, base);
 	/**
-	* Yield once in a while, but not too often,
-	* mostly to allow signal handling to take place.
-	*/
+	 * Yield once in a while, but not too often,
+	 * mostly to allow signal handling to take place.
+	 */
 	if (++xstream->rows % xstream->yield == 0)
 		fiber_sleep(0);
 }



More information about the Tarantool-patches mailing list