Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: Ilya Kosarev <i.kosarev@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH] memtx: allow quota overuse for truncation
Date: Sun, 20 Dec 2020 17:13:36 +0100	[thread overview]
Message-ID: <7787de2a-ba8d-66bd-d52b-c0c672d6e810@tarantool.org> (raw)
In-Reply-To: <1608162239.973321901@f42.i.mail.ru>

>     > diff --git a/src/box/memtx_space.c b/src/box/memtx_space.c
>     > index 73b4c450eb..cc431ea816 100644
>     > --- a/src/box/memtx_space.c
>     > +++ b/src/box/memtx_space.c
>     > @@ -327,8 +327,9 @@ memtx_space_execute_replace(struct space *space, struct txn *txn,
>     > struct memtx_space *memtx_space = (struct memtx_space *)space;
>     > struct txn_stmt *stmt = txn_current_stmt(txn);
>     > enum dup_replace_mode mode = dup_replace_mode(request->type);
>     > - stmt->new_tuple = memtx_tuple_new(space->format, request->tuple,
>     > - request->tuple_end);
>     > + stmt->new_tuple = space->format->vtab.tuple_new(space->format,
>     > + request->tuple,
>     > + request->tuple_end);
> 
>     2. Seems like an expensive change. You added +2 pointer
>     dereferences to a hot path.
> 
>     Last time when you worked on that I proposed to make space_truncate
>     use box.begin + quota disable + box_upsert + quota enable + commit.
>     So there are no yields between quota enable and disable. And no changes
>     in the code not related to truncation. Why didn't it work?
> 
> That does work, but then it was also discussed that we should use only
> huge slabs on disabled quota, so that quota can shrink back when freed.

Such discussion results are far from something trivial and obvious. Please,
specify that in the commit message and in the comments if possible.

Also I don't understand why can't you do that on the slab arena
level. Start allocating only 'huge' slabs if the quota is full, but
disabled.

> It also requires specific freeing for those tuples, that is why both new() and
> delete() are now used from vtab, which has specific version for truncate space.

Why do you need special freeing? memtx_tuple_delete() does not allocate
anything.

> There is an option to use only specific delete() from vtab and for allocation
> patch space_truncate() instead of new(), although it looks more strange.

Didn't understand what you mean.

> 
> 
>     > if (stmt->new_tuple == NULL)
>     > return -1;
>     > tuple_ref(stmt->new_tuple);
> 
>  
>  
> --
> Ilya Kosarev
>  

  reply	other threads:[~2020-12-20 16:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-11 15:37 Ilya Kosarev
2020-12-14 23:41 ` Vladislav Shpilevoy
2020-12-16 23:43   ` Ilya Kosarev
2020-12-20 16:13     ` Vladislav Shpilevoy [this message]
2020-12-21 18:15       ` Ilya Kosarev
2020-12-22 13:28         ` Vladislav Shpilevoy
2020-12-22 14:14           ` Ilya Kosarev
2020-12-22 14:22             ` Vladislav Shpilevoy

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=7787de2a-ba8d-66bd-d52b-c0c672d6e810@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=i.kosarev@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH] memtx: allow quota overuse for truncation' \
    /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