From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Sat, 28 Apr 2018 23:13:24 +0300 From: Konstantin Osipov Subject: Re: [tarantool-patches] [PATCH] replication: automatic skip duplicating rows in replication Message-ID: <20180428201324.GB4588@atlas> References: <20180413134412.20737-1-k.belyavskiy@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180413134412.20737-1-k.belyavskiy@tarantool.org> To: tarantool-patches@freelists.org Cc: vdavydov@tarantool.org, georgy@tarantool.org List-ID: * Konstantin Belyavskiy [18/04/13 16:45]: Konstantin, checking the configuration option for every conflicting row is too much overhead. Please instead implement a trigger which would push any change in box.cfg to a global variable in replication module. > - xstream_write_xc(applier->subscribe_stream, &row); > + if (xstream_write(applier->subscribe_stream, &row) != 0) { > + struct error *e = diag_last_error(diag_get()); > + /** > + * Silently skip ER_TUPLE_FOUND error if such > + * option is set in config. > + */ > + if (e->type == &type_ClientError && > + box_error_code(e) == ER_TUPLE_FOUND && > + cfg_geti("replication_skip_conflict")) > + diag_clear(diag_get()); > + else > + diag_raise(); > + } I'm talking about this bit. Thanks! -- Konstantin Osipov, Moscow, Russia, +7 903 626 22 32 http://tarantool.io - www.twitter.com/kostja_osipov