From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 91E006FC86; Wed, 24 Mar 2021 15:27:54 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 91E006FC86 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1616588874; bh=bYmusa87dJr+iOXb1SjtgQOBa19YvdUMDrbaJEJU6vo=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=ufL7OY/IPYM4e8F/mc7meE9TgMOeeN0nHujXKQStsWCzPQVNOs6POPaVRdxRSt90p gOB55qHx/SYXB7f87K3/xdcqBSABEXlUskq/k8IB1d8PJA/bTqZzvPOxxSqs6MWYWP tM1qGQgifMqEZVP5G0sx5BjOGEf4JGE+ILT0dAx4= Received: from smtp36.i.mail.ru (smtp36.i.mail.ru [94.100.177.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 841106BD3C for ; Wed, 24 Mar 2021 15:24:29 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 841106BD3C Received: by smtp36.i.mail.ru with esmtpa (envelope-from ) id 1lP2Ym-0004oK-Ku; Wed, 24 Mar 2021 15:24:29 +0300 To: v.shpilevoy@tarantool.org, gorcunov@gmail.com Date: Wed, 24 Mar 2021 15:24:17 +0300 Message-Id: X-Mailer: git-send-email 2.24.3 (Apple Git-128) In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD95D6E7CC48CB1F5F1DDD90A25A8FA528D0BFD61B598B81272182A05F538085040C87D93C5C7099F1A6127AC8532513304797B77AD1A56224F8A1464ED5C254EC9 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7DDEA16837FFA1F5BEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006378D071468F2F69688EA1F7E6F0F101C67CDEEF6D7F21E0D1D174C73DBBBFC76645F433A0BE06BC465152BBBD8C409C108FC9CBB0561F39A7C389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C0CB629EEF1311BF91D2E47CDBA5A96583BD4B6F7A4D31EC0BC014FD901B82EE079FA2833FD35BB23D27C277FBC8AE2E8B05EF1B56D39DD5F7389733CBF5DBD5E9B5C8C57E37DE458BD9DD9810294C998ED8FC6C240DEA76428AA50765F7900637B090B84583F90839D81D268191BDAD3DBD4B6F7A4D31EC0BEA7A3FFF5B025636D81D268191BDAD3D78DA827A17800CE7D86FDD7EACC21891EC76A7562686271EEC990983EF5C03292E808ACE2090B5E14AD6D5ED66289B5259CC434672EE63711DD303D21008E298C8A9BA7A39EFB766F5D81C698A659EA7E827F84554CEF50127C277FBC8AE2E8B72CEEB2601E22B093080793E9B1E17DDC77107234E2CFBA567F23339F89546C55F5C1EE8F4F765FC706619B2D358707475ECD9A6C639B01BBD4B6F7A4D31EC0BC0CAF46E325F83A522CA9DD8327EE4931B544F03EFBC4D57026D3A1080F4EF5CC4224003CC836476C0CAF46E325F83A50BF2EBBBDD9D6B0F05F538519369F3743B503F486389A921A5CC5B56E945C8DA X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975C5DD32608FC869F5DBCA210E199FC6E15C951AE57DC878F459C2B6934AE262D3EE7EAB7254005DCED7532B743992DF240BDC6A1CF3F042BAD6DF99611D93F60EF0417BEADF48D1460699F904B3F4130E343918A1A30D5E7FCCB5012B2E24CD356 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34F0A5F58274334C956337670D978C04A10C9B90B09481081ED353EC00B59A670840997221DA3038C71D7E09C32AA3244CA10FB5DA42EAB7982A45B9C7CBEC410D8A6D4CC6FBFAC251927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojNqBGwjEnRoU3XkGMTzx12Q== X-Mailru-Sender: 583F1D7ACE8F49BDD2846D59FC20E9F86C523D0B3819F67ED052BBFE4CFB2D0348096E5C1D61DE70424AE0EB1F3D1D21E2978F233C3FAE6EE63DB1732555E4A8EE80603BA4A5B0BC112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: [Tarantool-patches] [PATCH v2 7/7] replication: do not ignore replica vclock on register X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Serge Petrenko via Tarantool-patches Reply-To: Serge Petrenko Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" There was a bug in box_process_register. It decoded replica's vclock but never used it when sending the registration stream. So the replica might lose the data in range (replica_vclock, start_vclock). Follow-up #5566 --- src/box/box.cc | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/box/box.cc b/src/box/box.cc index 292a54213..0bcb505a8 100644 --- a/src/box/box.cc +++ b/src/box/box.cc @@ -2127,8 +2127,8 @@ box_process_register(struct ev_io *io, struct xrow_header *header) assert(header->type == IPROTO_REGISTER); struct tt_uuid instance_uuid = uuid_nil; - struct vclock vclock; - xrow_decode_register_xc(header, &instance_uuid, &vclock); + struct vclock replica_vclock; + xrow_decode_register_xc(header, &instance_uuid, &replica_vclock); if (!is_box_configured) tnt_raise(ClientError, ER_LOADING); @@ -2154,7 +2154,8 @@ box_process_register(struct ev_io *io, struct xrow_header *header) "wal_mode = 'none'"); } - struct gc_consumer *gc = gc_consumer_register(&replicaset.vclock, + vclock_reset(&replica_vclock, 0, vclock_get(&replicaset.vclock, 0)); + struct gc_consumer *gc = gc_consumer_register(&replica_vclock, "replica %s", tt_uuid_str(&instance_uuid)); if (gc == NULL) diag_raise(); @@ -2163,9 +2164,6 @@ box_process_register(struct ev_io *io, struct xrow_header *header) say_info("registering replica %s at %s", tt_uuid_str(&instance_uuid), sio_socketname(io->fd)); - struct vclock start_vclock; - vclock_copy(&start_vclock, &replicaset.vclock); - /** * Call the server-side hook which stores the replica uuid * in _cluster space. @@ -2180,10 +2178,10 @@ box_process_register(struct ev_io *io, struct xrow_header *header) /* * Feed replica with WALs in range - * (start_vclock, stop_vclock) so that it gets its + * (replica_vclock, stop_vclock) so that it gets its * registration. */ - relay_final_join(io->fd, header->sync, &start_vclock, &stop_vclock); + relay_final_join(io->fd, header->sync, &replica_vclock, &stop_vclock); say_info("final data sent."); struct xrow_header row; -- 2.24.3 (Apple Git-128)