From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id CD20824D05 for ; Fri, 4 Jan 2019 05:32:53 -0500 (EST) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NsUQa6TgXu_5 for ; Fri, 4 Jan 2019 05:32:53 -0500 (EST) Received: from smtp58.i.mail.ru (smtp58.i.mail.ru [217.69.128.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 8EFCC22A82 for ; Fri, 4 Jan 2019 05:32:53 -0500 (EST) From: Georgy Kirichenko Subject: [tarantool-patches] [PATCH 4/5] Emit NOP if an applier skips row Date: Fri, 4 Jan 2019 13:34:14 +0300 Message-Id: <4f7b4d6b6625186eada32818305f93cdec4ae8d0.1546593619.git.georgy@tarantool.org> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: tarantool-patches@freelists.org Cc: Georgy Kirichenko Fill lsn gaps with NOPs if applier configured to skip conflicting rows. Needed for: #980 --- src/box/applier.cc | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/box/applier.cc b/src/box/applier.cc index fbceadb2b..b05d72c73 100644 --- a/src/box/applier.cc +++ b/src/box/applier.cc @@ -527,23 +527,26 @@ applier_subscribe(struct applier *applier) row.replica_id); vclock_follow_xrow(&replicaset.applier.vclock, &row); int res = xstream_write(applier->subscribe_stream, &row); - if (res != 0) { - struct error *e = diag_last_error(diag_get()); + struct error *e = diag_last_error(diag_get()); + if (res != 0 && e->type == &type_ClientError && + box_error_code(e) == ER_TUPLE_FOUND && + replication_skip_conflict) { /** * 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 && - replication_skip_conflict) - diag_clear(diag_get()); - else { - /* Rollback lsn to have a chance for a retry. */ - vclock_set(&replicaset.applier.vclock, - row.replica_id, old_lsn); - latch_unlock(latch); - diag_raise(); - } + diag_clear(diag_get()); + row.type = IPROTO_NOP; + row.bodycnt = 0; + res = xstream_write(applier->subscribe_stream, + &row); + } + if (res != 0) { + /* Rollback lsn to have a chance for a retry. */ + vclock_set(&replicaset.applier.vclock, + row.replica_id, old_lsn); + latch_unlock(latch); + diag_raise(); } } latch_unlock(latch); -- 2.20.1