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 D9FE06F852; Tue, 16 Nov 2021 12:53:53 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org D9FE06F852 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1637056434; bh=4HxXfIwvyN47AhjDDVzIC7aKUzxJNDWTNTehmpxDsPk=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=xD7iuxI7e4Vxy+ry+sYocqgKZ2KtsBz1UY9tERml703n/bjvqVSb8tZw4DmvipOqy WxGpltgS8Qa1Uma05LWR7f96aPSAsNEf1GOLaPDFPhdYWNIXst1z85Lj8IQUYTYaCM 4aF0ePVf6eNXK76vVX5GujaIjIIHKdVP1AyQ+Ts0= Received: from smtp17.mail.ru (smtp17.mail.ru [94.100.176.154]) (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 7A4326F852 for ; Tue, 16 Nov 2021 12:53:52 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 7A4326F852 Received: by smtp17.mail.ru with esmtpa (envelope-from ) id 1mmv9z-0002w2-O1; Tue, 16 Nov 2021 12:53:52 +0300 Message-ID: Date: Tue, 16 Nov 2021 12:53:51 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Content-Language: en-GB To: Vladislav Shpilevoy , tarantool-patches@dev.tarantool.org References: <225fd821-26be-3afb-3ec5-c0b33487c5a1@tarantool.org> <76dcc21e-0518-b5ef-4b10-e7c8578e505a@tarantool.org> <6a38283a-1fa3-f2f3-a085-cfa6ca81fb72@tarantool.org> In-Reply-To: <6a38283a-1fa3-f2f3-a085-cfa6ca81fb72@tarantool.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD9731B3922EC063979C43A6585748E9610BDC1ABCFD86A591900894C459B0CD1B9999DBD9B3D2E446682BCC66CC1ACF59714AFEA9E3F1D53D7959CCC59C13430CB X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE78E8764B5BC580342EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637EF59B520676799BC8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D87BE809855549DD742B9A4B94DE2351B5117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC974A882099E279BDA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352033AC447995A7AD18618001F51B5FD3F9D2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EE4B6963042765DA4BE21AE983DBD7FFC1D8FC6C240DEA7642DBF02ECDB25306B2B78CF848AE20165D0A6AB1C7CE11FEE3568FCE88E0C8489DAD7EC71F1DB88427C4224003CC836476EA7A3FFF5B025636E2021AF6380DFAD1A18204E546F3947CB11811A4A51E3B096D1867E19FE1407959CC434672EE6371089D37D7C0E48F6C8AA50765F7900637B8F435DEDE9E76EBEFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A213B5FB47DCBC3458834459D11680B505355D63C32A41ED37F573C35F2CEDD7A4 X-C1DE0DAB: 0D63561A33F958A5958A6093C37EC09B9505B917B2CD55C1498C360506496BD2D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7506FE1F977233B9BB410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34F804B400765FFFF975A5D0ACAB830D4FFC5C46B711F80952E0D2257D8DF27E5809B62909188F089E1D7E09C32AA3244C081790582B2F8C5951DCDD71CCF3F81033C9DC155518937F729B2BEF169E0186 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojTPuBkNIN61HbHGYg4xYGuw== X-Mailru-Sender: 583F1D7ACE8F49BD7B46BC6C7C9DD5A81A5B725F5DDF9D23A33150D0D57DA7C224F5F659B62B06BD424AE0EB1F3D1D21E2978F233C3FAE6EE63DB1732555E4A8EE80603BA4A5B0BC112434F685709FCF0DA7A0AF5A3A8387 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v2 10/11] box: enrich ER_READONLY with new details 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" 16.11.2021 00:56, Vladislav Shpilevoy пишет: >> Thanks for the changes! >> >> One final note: >> I propose to move box_ro_reason() from the last commit here and use it >> when setting error reason, so that error.reason would be the same as >> box.info.ro_reason. > I added more details to error message than to ro_reason because when you > see ro_reason, you can go and check other fields of box.info for details. > When you have only an error object, and what is worse - it is cast to a > string during packing, you don't have a place to look up the details > already. Thus I wanted the error object to be self-sufficient. Even if > it degrades to a simple string during marshaling. I suppose you misunderstood me. I don't want to remove anything from the error object or the message, I just want to unify error.reason and ro_reason. There are 4 error reasons now, and error_object.reason / box.info.ro_reason vary in their representation: There are elections and reasons "election" and "election", There is limbo being someone else's and the reasons being "synchro" and "synchro" And then there are `is_ro` and `is_orphan`, both having error.reason == "state". But box.cfg.ro_reason differs for them. It's "config" for `is_ro` and "orphan" for `is_orphan`. My proposal was to make error.reason match ro_reason (reuse box_ro_reason() when setting error.reason). Feel free to ignore this comment. -- Serge Petrenko