[Tarantool-patches] [PATCH v2 10/11] box: enrich ER_READONLY with new details
sergepetrenko at tarantool.org
Tue Nov 16 12:53:51 MSK 2021
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
> 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
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
And then there are `is_ro` and `is_orphan`, both having error.reason ==
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
Feel free to ignore this comment.
More information about the Tarantool-patches