From: Kirill Yukhin <kyukhin@tarantool.org>
To: tarantool-patches@freelists.org
Cc: kostja@tarantool.org
Subject: [tarantool-patches] Re: [PATCH 1/2] xlog: simplify xdir_add_vclock protocol
Date: Wed, 22 Aug 2018 11:03:40 +0300 [thread overview]
Message-ID: <20180822080340.hq5rqu4cutpzi6cd@tarantool.org> (raw)
In-Reply-To: <70ba3452fba34b4a1529f17e4872924005ea439b.1534710806.git.vdavydov.dev@gmail.com>
Hello,
On 19 авг 23:44, Vladimir Davydov wrote:
> We add the vclock of a new snapshot/xlog/vylog file to the corresponding
> xdir, because we need it for garbage collection and backup. We use the
> xdir_add_vclock() function for that. Currently, the function protocol is
> rather abstruse: it expects that the caller allocates a vclock with
> malloc() and passes the ownership on to the xdir by calling this
> function. This is done that way, because we add a vclock to an xdir
> after committing a new xlog file, where we can't fail anymore. Since
> malloc() can theoretically fail, we allocate a vclock before writing an
> xlog and add it to an xdir only after the xlog is committed. This makes
> the code look rather complicated.
>
> Actually, as explained in #3534, malloc() doesn't normally fail so this
> complexity is in fact needless and only makes it more difficult to patch
> the code. Let's simplify the code by making xdir_add_vclock() allocate
> vclock by itself and, since it can't fail, panic on allocation error.
> ---
> https://github.com/tarantool/tarantool/issues/3624
> https://github.com/tarantool/tarantool/commits/dv/gh-3624-vy-fix-vylog-backup
I've checked the patchset into 1.10 branch.
--
Regards, Kirill Yukhin
prev parent reply other threads:[~2018-08-22 8:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-19 20:44 Vladimir Davydov
2018-08-19 20:44 ` [PATCH 2/2] vinyl: fix backup skipping vylog created after recovery Vladimir Davydov
2018-08-22 8:03 ` Kirill Yukhin [this message]
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=20180822080340.hq5rqu4cutpzi6cd@tarantool.org \
--to=kyukhin@tarantool.org \
--cc=kostja@tarantool.org \
--cc=tarantool-patches@freelists.org \
--subject='[tarantool-patches] Re: [PATCH 1/2] xlog: simplify xdir_add_vclock protocol' \
/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