From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org> To: Georgy Kirichenko <georgy@tarantool.org>, tarantool-patches@dev.tarantool.org Subject: Re: [Tarantool-patches] [PATCH 3/6] xstream: get rid of an exception Date: Sat, 23 Nov 2019 14:45:56 +0100 [thread overview] Message-ID: <1a0049f1-7f53-714a-307a-24ed07415fd2@tarantool.org> (raw) In-Reply-To: <513167ba5e8823d58cbe101e10bfa423fff083a1.1574178520.git.georgy@tarantool.org> Thanks for the patch! See 3 comments below. On 19/11/2019 17:04, Georgy Kirichenko wrote: > Refactoring: make xstream C-compliant > > Part of #380 > --- > src/box/box.cc | 5 +++-- > src/box/relay.cc | 23 +++++++++++++---------- > src/box/xstream.cc | 7 +------ > src/box/xstream.h | 2 +- > 4 files changed, 18 insertions(+), 19 deletions(-) > > diff --git a/src/box/box.cc b/src/box/box.cc > index 6323e5e6e..f41ef9ce8 100644 > --- a/src/box/box.cc > +++ b/src/box/box.cc > @@ -321,7 +321,7 @@ recovery_journal_create(struct recovery_journal *journal, struct vclock *v) > journal->vclock = v; > } > > -static void > +static int > apply_wal_row(struct xstream *stream, struct xrow_header *row) > { > struct request request; > @@ -330,7 +330,7 @@ apply_wal_row(struct xstream *stream, struct xrow_header *row) > struct space *space = space_cache_find_xc(request.space_id); > if (box_process_rw(&request, space, NULL) != 0) { > say_error("error applying row: %s", request_str(&request)); > - diag_raise(); > + return -1; 1. apply_wal_row() still throws exceptions. It uses xrow_decode_dml_xc() and space_cache_find_xc(). > } > } > struct wal_stream *xstream = > diff --git a/src/box/relay.cc b/src/box/relay.cc > index 202620694..fe5e0cfc9 100644 > --- a/src/box/relay.cc > +++ b/src/box/relay.cc > @@ -165,11 +165,11 @@ relay_last_row_time(const struct relay *relay) > return relay->last_row_time; > } > > -static void > +static int > relay_send(struct relay *relay, struct xrow_header *packet); 2. relay_send_heartbeat() still assumes, that relay_send() throws. > -static void > +static int > relay_send_initial_join_row(struct xstream *stream, struct xrow_header *row); > -static void > +static int > relay_send_row(struct xstream *stream, struct xrow_header *row); > > struct relay * > diff --git a/src/box/xstream.cc b/src/box/xstream.cc > index c77e4360e..80f3030d0 100644 > --- a/src/box/xstream.cc > +++ b/src/box/xstream.cc > @@ -35,10 +35,5 @@ > int > xstream_write(struct xstream *stream, struct xrow_header *row) > { > - try { > - stream->write(stream, row); > - } catch (Exception *e) { > - return -1; > - } > - return 0; > + return stream->write(stream, row); > } 3. Now you can drop xstream.cc, and make xstream_write() static inline in xstream.h header.
next prev parent reply other threads:[~2019-11-23 13:39 UTC|newest] Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-11-19 16:04 [Tarantool-patches] [PATCH 0/6] Synchronous replication preparation Georgy Kirichenko 2019-11-19 16:04 ` [Tarantool-patches] [PATCH 1/6] recovery: do not throw an error Georgy Kirichenko 2019-11-23 13:45 ` Vladislav Shpilevoy 2019-11-19 16:04 ` [Tarantool-patches] [PATCH 2/6] coio: do not htrow an exception Georgy Kirichenko 2019-11-23 13:45 ` Vladislav Shpilevoy 2019-11-19 16:04 ` [Tarantool-patches] [PATCH 3/6] xstream: get rid of " Georgy Kirichenko 2019-11-23 13:45 ` Vladislav Shpilevoy [this message] 2019-11-19 16:04 ` [Tarantool-patches] [PATCH 4/6] vinyl: do not insert vy_tx twice into writers list Georgy Kirichenko 2019-11-19 16:04 ` [Tarantool-patches] [PATCH 5/6] box: improve recovery journal Georgy Kirichenko 2019-11-23 13:46 ` Vladislav Shpilevoy 2019-11-19 16:04 ` [Tarantool-patches] [PATCH 6/6] recovery: follow transaction boundaries while recovery or join Georgy Kirichenko 2019-11-23 13:46 ` Vladislav Shpilevoy 2019-11-20 17:15 ` [Tarantool-patches] [PATCH 0/6] Synchronous replication preparation Konstantin Osipov 2019-11-23 13:45 ` Vladislav Shpilevoy
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=1a0049f1-7f53-714a-307a-24ed07415fd2@tarantool.org \ --to=v.shpilevoy@tarantool.org \ --cc=georgy@tarantool.org \ --cc=tarantool-patches@dev.tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH 3/6] xstream: get rid of an exception' \ /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