From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Thu, 7 Mar 2019 12:31:04 +0300 From: Vladimir Davydov Subject: Re: [tarantool-patches] [PATCH v2 1/3] Applier gets rid of a xstream Message-ID: <20190307093104.5al4drqbmayyiufq@esperanza> References: <166b45adc75c0753d36ea473d57ac452548fbbec.1551902962.git.georgy@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <166b45adc75c0753d36ea473d57ac452548fbbec.1551902962.git.georgy@tarantool.org> To: Georgy Kirichenko Cc: tarantool-patches@freelists.org List-ID: 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); }