Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: Alex Khatskevich <avkhatskevich@tarantool.org>,
	tarantool-patches@freelists.org
Subject: [tarantool-patches] Re: [PATCH 3/3] Add error messages
Date: Thu, 7 Jun 2018 21:44:19 +0300	[thread overview]
Message-ID: <5795073d-1821-3c31-927e-4363829eeb67@tarantool.org> (raw)
In-Reply-To: <f1c00101-13d7-2569-e2e6-a6e749fa9f25@tarantool.org>


Thanks for the fixes! Finally the errors have become pretty.

>> 4. Same as 2.
> Fixed along with
> "bucket moving to " -> "bucket moving to "

What the difference? "bucket moving to" == "bucket moving to".

>>
>>>       end
>>>       assert(not errcode)
>>>       assert(mode == 'read' and bucket_is_readable(bucket) or
>>>              mode == 'write' and bucket_is_writable(bucket))
>>> -::finish::
>>> +::wrong_bucket::
>>
>> 6. The code below is executed both on error and on success. But
>> label is named 'wrong_bucket'. It is not correct. On success
>> path it is guaranteed that bucket ~= nil.
> Renamed back to `finish`. IMHO `wrong_bucket` suited well here.

You had labeled the success code as error processing. It is not ok.
And in the same code you check 'if bucket and ...', but bucket on
success is not nil - it is guaranteed. We must optimize the common
case. And the bucket is ok most of time.

+-- Only WRONG_BUCKET errors use this label.

This is wrong. See three lines above - they process a case when the
bucket is ok. You can label it ::wrong_bucket::, but then you must
separate this code from success path. I refactored this function,
you can look at it on the master branch.

The patchset is pushed with my fixes.

  reply	other threads:[~2018-06-07 18:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-06 15:57 [tarantool-patches] [PATCH 0/3][vshard] " AKhatskevich
2018-06-06 15:57 ` [tarantool-patches] [PATCH 1/3] Fix test on bucket_transferring error AKhatskevich
2018-06-06 15:57 ` [tarantool-patches] [PATCH 2/3] Refactor error reporting system AKhatskevich
2018-06-07 12:22   ` [tarantool-patches] " Vladislav Shpilevoy
2018-06-07 16:13     ` Alex Khatskevich
2018-06-06 15:57 ` [tarantool-patches] [PATCH 3/3] Add error messages AKhatskevich
2018-06-07 12:22   ` [tarantool-patches] " Vladislav Shpilevoy
2018-06-07 16:12     ` Alex Khatskevich
2018-06-07 18:44       ` Vladislav Shpilevoy [this message]
2018-06-07 12:22 ` [tarantool-patches] Re: [PATCH 0/3][vshard] " Vladislav Shpilevoy
2018-06-07 13:16   ` Alex Khatskevich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5795073d-1821-3c31-927e-4363829eeb67@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=avkhatskevich@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [PATCH 3/3] Add error messages' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox