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 62C256EC55; Thu, 10 Jun 2021 16:35:32 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 62C256EC55 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1623332132; bh=HmH4JWaEzIEJnNgj2KVO/6UMUmBLXFWZxzLsWZlGujI=; 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=LETKeLr9HVXBAqB28VzXkf3/WHCe4/hA163hLrGNg+fYeJQxD93tCVfkph89RXA57 reRNvvEzqgMs29iIS7do8LVSsiui9z/hXlWI51JHssqAFpLbrC6xM3a7kXRSiODgVG Z4SFXZmmc7R05cf0lyah9wbDMQA8xwNpLSJ0lQKM= Received: from smtp63.i.mail.ru (smtp63.i.mail.ru [217.69.128.43]) (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 8BC536EC56 for ; Thu, 10 Jun 2021 16:33:07 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 8BC536EC56 Received: by smtp63.i.mail.ru with esmtpa (envelope-from ) id 1lrKny-0007EB-Jo; Thu, 10 Jun 2021 16:33:07 +0300 To: v.shpilevoy@tarantool.org, gorcunov@gmail.com Date: Thu, 10 Jun 2021 16:32:55 +0300 Message-Id: <93a4765cb6918512946bf9366fe4ad478345bce1.1623331925.git.sergepetrenko@tarantool.org> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD9D5B0DA836B685C549A9F97C297FFF2C725C7934AD8E7B4B9182A05F538085040B781B9B9ADB68168ABA2381F7AAAB13EB753892B81FAD522B6C915D3B92AF954 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE75DF2B1F23425CAE5EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637E893C22CB255350D8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8BAB7598A8AE46ACCBA9F635559AE2AF6117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCCC99A7B061B94ED7A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F4460429728776938767073520B28585415E75ADA9F6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA73AA81AA40904B5D9A18204E546F3947CBBEA9FB9FD75E40E2D242C3BD2E3F4C64AD6D5ED66289B52698AB9A7B718F8C46E0066C2D8992A16725E5C173C3A84C33AFBBA56C05A32E5BA3038C0950A5D36B5C8C57E37DE458B0BC6067A898B09E46D1867E19FE14079C09775C1D3CA48CF3D321E7403792E342EB15956EA79C166A417C69337E82CC275ECD9A6C639B01B78DA827A17800CE732FCE54C4D9A645443847C11F186F3C59DAA53EE0834AAEE X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A24209795067102C07E8F7B195E1C97831B61BC0640769A5B11BBFD1EA3789D373 X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975C8874A2D3FA5089FEF9B5C837D407F3D4DA9F29647D46AA919C2B6934AE262D3EE7EAB7254005DCED7532B743992DF240BDC6A1CF3F042BAD6DF99611D93F60EFD99FB7B2A39B4961699F904B3F4130E343918A1A30D5E7FCCB5012B2E24CD356 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34EB7BD66E9101C1009E4F816D10455BB52C44B37714A3BBACF4715E0410C3F15EB355963C8408780B1D7E09C32AA3244CF6B2A0B133C3B98CD4D892553E3FCDFDC3B3ADDA61883BB5927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojbL9S8ysBdXiiA81jxGMgNj81lY/gUYAc X-Mailru-Sender: 583F1D7ACE8F49BD9DF7A8DAE6E2B08A7C268FF7D915934837975EA6253DB19EDF580C3AF0510E41424AE0EB1F3D1D21E2978F233C3FAE6EE63DB1732555E4A8EE80603BA4A5B0BC112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: [Tarantool-patches] [PATCH 5/7] replication: send latest effective promote in initial join 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" A joining instance may never receive the latest PROMOTE request, which is the only source of information about the limbo owner. Send out the latest limbo state (e.g. the latest applied PROMOTE request) together with the initial join snapshot. Part-of #6034 --- src/box/applier.cc | 5 +++++ src/box/relay.cc | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/box/applier.cc b/src/box/applier.cc index 33181fdbf..dde045996 100644 --- a/src/box/applier.cc +++ b/src/box/applier.cc @@ -458,6 +458,11 @@ applier_wait_snapshot(struct applier *applier) xrow_decode_vclock_xc(&row, &replicaset.vclock); } break; /* end of stream */ + } else if (iproto_type_is_promote_request(row.type)) { + struct synchro_request req; + if (xrow_decode_synchro(&row, &req) != 0) + diag_raise(); + txn_limbo_process(&txn_limbo, &req); } else if (iproto_type_is_error(row.type)) { xrow_decode_error_xc(&row); /* rethrow error */ } else { diff --git a/src/box/relay.cc b/src/box/relay.cc index b1571b361..2781b2c22 100644 --- a/src/box/relay.cc +++ b/src/box/relay.cc @@ -399,12 +399,22 @@ relay_initial_join(int fd, uint64_t sync, struct vclock *vclock) if (txn_limbo_wait_confirm(&txn_limbo) != 0) diag_raise(); + struct synchro_request req; + txn_limbo_checkpoint(&txn_limbo, &req); + /* Respond to the JOIN request with the current vclock. */ struct xrow_header row; xrow_encode_vclock_xc(&row, vclock); row.sync = sync; coio_write_xrow(&relay->io, &row); + /* Send out the latest limbo state. */ + char body[XROW_SYNCHRO_BODY_LEN_MAX]; + xrow_encode_synchro(&row, body, &req); + row.replica_id = req.replica_id; + row.sync = sync; + coio_write_xrow(&relay->io, &row); + /* Send read view to the replica. */ engine_join_xc(&ctx, &relay->stream); } -- 2.30.1 (Apple Git-130)