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 89DF16EC55; Mon, 12 Jul 2021 13:14:11 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 89DF16EC55 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1626084851; bh=cfGbcyDu+JTp+iiJbyasY61wPuRlS3WAt3HwCgFNKPk=; h=To:Cc:References:Date:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=f9xYw6V0rDq90HF4vFYm7FUYoc0VsPU2+6bJvKgAnaszXzLnMabrOGTasjYGjx4mR kxa3wIKkZR5zOFi52twTfhWg2xSL0a53v4ys7I9KrEMVXf1+s0112rkvErg9P9g708 8GudZZ0UWAc6P3lZOpKzbMBDDLmPC7N3WcYhy/N0= Received: from smtp29.i.mail.ru (smtp29.i.mail.ru [94.100.177.89]) (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 CF4ED6EC55 for ; Mon, 12 Jul 2021 13:14:10 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org CF4ED6EC55 Received: by smtp29.i.mail.ru with esmtpa (envelope-from ) id 1m2sx0-0006lL-5L; Mon, 12 Jul 2021 13:14:10 +0300 To: Cyrill Gorcunov Cc: v.shpilevoy@tarantool.org, tarantool-patches@dev.tarantool.org References: <20210709074048.18169-1-sergepetrenko@tarantool.org> <7d4e959e-baab-85ff-488d-d1dbfd5e80a5@tarantool.org> Message-ID: <21e11a11-c771-e014-3874-3083dbdaf4c7@tarantool.org> Date: Mon, 12 Jul 2021 13:14:09 +0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD954DFF1DC42D673FBBD367E85DD81335AB0D1C33BC341B12B182A05F538085040FBCF39148280CAF16AD0E1995BCA78309B2F7781AF8BB23EA543F94BC95BFF8F X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE75644E22E05AA81AEB287FD4696A6DC2FA8DF7F3B2552694A4E2F5AFA99E116B42401471946AA11AF176DF2183F8FC7C08FF511FAAD1B1E988F08D7030A58E5AD1A62830130A00468AEEEE3FBA3A834EE7353EFBB55337566425F95675CFBD49F42A29BF49CE0E73CC85D93F66BECC9E8A471835C12D1D9774AD6D5ED66289B5278DA827A17800CE7A6779F98BF527B7A9FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C3C72A182EC22DCD89117882F4460429728AD0CFFFB425014E868A13BD56FB6657D81D268191BDAD3DC09775C1D3CA48CF50ABA0532B7729C2BA3038C0950A5D36C8A9BA7A39EFB766EC990983EF5C0329BA3038C0950A5D36D5E8D9A59859A8B62BBA301C0C06D4B176E601842F6C81A1F004C906525384307823802FF610243DF43C7A68FF6260569E8FC8737B5C2249EC8D19AE6D49635B68655334FD4449CB9ECD01F8117BC8BEAAAE862A0553A39223F8577A6DFFEA7CB1724D34C644744043847C11F186F3C59DAA53EE0834AAEE X-C1DE0DAB: 0D63561A33F958A5BE6FFA76768A42BB34EF5D95C042DFB27B20310E7989D71DD59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA753753CEE10E4ED4A7410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3498EF79680EE3725CB553B674836829D52281615E3ABA8377F0B0BFBF818B1E57E7C5D88469FF03931D7E09C32AA3244C82B76D5AD698F8CFB46679A3377808CD24AF4FAF06DA24FDFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj/3sbGI30Xhf1i9wQw6eGrA== X-Mailru-Sender: 583F1D7ACE8F49BDCE9F948DA3B7A953EFBA2B07CF1E746A0C59AD282CAE37B27956B7A5B1865BD46BB2E709EA627F343C7DDD459B58856F0E45BC603594F5A135B915D4279FF0579437F6177E88F7363CDA0F3B3F5B9367 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH] replication: stop pushing TimedOut error to the replica 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 Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" 09.07.2021 13:41, Cyrill Gorcunov пишет: > On Fri, Jul 09, 2021 at 11:30:20AM +0300, Serge Petrenko wrote: >> Thanks! No problem, will rework. >> It might be better to not allocate any string at all. >> I can simply allocate the needed buffer on the region (where the msgpack >> will be encoded), and encode the string header, and leave the >> buffer with whatever contents it has (it'll probably be filled >> with 0x50 bytes, it's the slab poison symbol). >> >> Cool, good idea! I've found an even better solution: We don't care for the actual contents of the error, so it's fine to fill the buffer with whatever junk we come up with. (That's because the error is meant to fill the remaining buffer space after a partially written row). 'E' is for error injection, since we have 'P' for slab poison. I've force-pushed the following change: ==================== diff --git a/src/box/xrow.c b/src/box/xrow.c index fae9861a5..c4647c6cb 100644 --- a/src/box/xrow.c +++ b/src/box/xrow.c @@ -552,10 +552,8 @@ iproto_write_error(int fd, const struct error *e, uint32_t schema_version,         mpstream_iproto_encode_error(&stream, e);         struct errinj *inj = errinj(ERRINJ_IPROTO_WRITE_ERROR_LARGE,                                     ERRINJ_INT); -       if (inj != NULL && inj->iparam > 0) { -               char garbage[inj->iparam]; -               mpstream_encode_strn(&stream, garbage, inj->iparam); -       } +       if (inj != NULL && inj->iparam > 0) +               mpstream_memset(&stream, 'E', inj->iparam);         mpstream_flush(&stream);         if (is_error)                 goto cleanup; ===================== -- Serge Petrenko