[Tarantool-patches] [PATCH v2 10/11] box: enrich ER_READONLY with new details

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Wed Nov 17 01:08:24 MSK 2021

>>> 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

More information about the Tarantool-patches mailing list