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 50F6A6E459; Wed, 17 Nov 2021 01:08:29 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 50F6A6E459 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1637100509; bh=opL4kceJU8wI8DzpnWF/TvC3CnXHjPKzq19sCPAsgbM=; 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=l6byXOTJMR1+b6c3dOAuKyh06t0r3g+REnSLlzblvwh9TudGP1+QybqnKvUmcGSu2 mNCGPAvJmpy/fjkxaYIXHs8LFoxmykGhz/vjmDyLDEaqgvHVeOWjG4GvcD61Gp1aIZ P7ldqXK3+KzYmBG1JPnJ4WSH4J4OSlgnJw8snS/g= Received: from smtpng1.i.mail.ru (smtpng1.i.mail.ru [94.100.181.251]) (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 08E9B6E459 for ; Wed, 17 Nov 2021 01:08:25 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 08E9B6E459 Received: by smtpng1.m.smailru.net with esmtpa (envelope-from ) id 1mn6cr-0000E1-7f; Wed, 17 Nov 2021 01:08:25 +0300 Message-ID: <9c9f576a-f54f-b737-c84f-6354ef24af6a@tarantool.org> Date: Tue, 16 Nov 2021 23:08:24 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.3.1 Content-Language: en-US To: Serge Petrenko , 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: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-4EC0790: 10 X-7564579A: EEAE043A70213CC8 X-77F55803: 4F1203BC0FB41BD927BBD05C2915ABC3F5F793E7CCBBEEA633125E1C7D4BB9B8182A05F5380850404C228DA9ACA6FE27D454EF7CED2FB5F5EC07BA31AFFECAC8C6D974E1204C1C23A394BC80087DD9A3 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7F9D3BE5B596754B8C2099A533E45F2D0395957E7521B51C2CFCAF695D4D8E9FCEA1F7E6F0F101C6778DA827A17800CE72AC9FB60380F23AEEA1F7E6F0F101C6723150C8DA25C47586E58E00D9D99D84E1BDDB23E98D2D38BBCA57AF85F7723F2BC6823AB05C5AE932D2BC39C540ED663CC7F00164DA146DAFE8445B8C89999728AA50765F7900637F924B32C592EA89F389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC8D2DCF9CF1F528DBCF6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA7E827F84554CEF5019E625A9149C048EE9ECD01F8117BC8BEE2021AF6380DFAD18AA50765F790063735872C767BF85DA227C277FBC8AE2E8BDAE3FA6833AEA0C275ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A213B5FB47DCBC3458834459D11680B505F4279711C3CC3D761FA36C2B2A404093 X-C1DE0DAB: 0D63561A33F958A543D614E77F52C2A2FB9C8867FE9D32E0CE438E297A6ABE43D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7506FE1F977233B9BB410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34EE6683D9E546CC62B603B467C43E606929CCE2FD213418FF500CDD72D405B2F5F7C81E1DD9F2CFA11D7E09C32AA3244C082C4EDCABC7C10BBEA6E7CD05920F131DD47778AE04E04D729B2BEF169E0186 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj81eoY04Pbonl4Vg6hCgDvg== X-Mailru-Sender: 689FA8AB762F7393C37E3C1AEC41BA5D1EB357BEC0F54AFE59863BCC061F8CB53841015FED1DE5223CC9A89AB576DD93FB559BB5D741EB963CF37A108A312F5C27E8A8C3839CE0E267EA787935ED9F1B 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: Vladislav Shpilevoy via Tarantool-patches Reply-To: Vladislav Shpilevoy Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" >>> 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. I like the idea. I applied your suggestion. Now error.reason can be 'config' and 'orphan'.