Tarantool development patches archive
 help / color / mirror / Atom feed
From: Konstantin Belyavskiy <k.belyavskiy@tarantool.org>
To: tarantool-patches@freelists.org
Subject: [tarantool-patches] [PATCH v4 0/2] force gc on running out of disk space
Date: Tue,  3 Jul 2018 16:03:45 +0300	[thread overview]
Message-ID: <20180703130347.26296-1-k.belyavskiy@tarantool.org> (raw)

Garbage collector do not delete xlog unless replica do not notify
master with newer vclock. This can lead to running out of disk
space error and this is not right behaviour since it will stop the
master.
Fix it by forcing gc to clean xlogs for replica with highest lag.
Add an error injection and a test.
Split between two different commits to improve readability.
First is a proposal to separate tx_prio thread from tx since they
behave differently (the first does not support yield call).
Second is actually a proposal to use messages from wall thread to
tx thread to notify gc to do not keep logs for the oldest replica.
Changes in V2:
- Promoting error from wal_thread to tx via cpipe.
Changes in V3:
- Delete consumers and only for replicas (but not backup).
Changes in V4:
- Bug fix and small changes according to review.

Tichet: https://github.com/tarantool/tarantool/issues/3397
Branch: kbelyavs/gh-3397-force-del-logs-on-no-disk-space

Konstantin Belyavskiy (2):
  replication: rename thread from tx to tx_prio
  replication: force gc to clean xdir on ENOSPC err

 src/box/box.cc                                     |   1 +
 src/box/gc.c                                       |  49 +++++++++
 src/box/gc.h                                       |  16 +++
 src/box/relay.cc                                   |   1 +
 src/box/wal.cc                                     |  44 ++++++--
 src/errinj.h                                       |   1 +
 src/fio.c                                          |   7 ++
 test/box/errinj.result                             |   2 +
 test/replication/kick_dead_replica_on_enspc.result | 121 +++++++++++++++++++++
 .../kick_dead_replica_on_enspc.test.lua            |  56 ++++++++++
 test/replication/suite.ini                         |   2 +-
 11 files changed, 291 insertions(+), 9 deletions(-)
 create mode 100644 test/replication/kick_dead_replica_on_enspc.result
 create mode 100644 test/replication/kick_dead_replica_on_enspc.test.lua

-- 
2.14.3 (Apple Git-98)

             reply	other threads:[~2018-07-03 13:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-03 13:03 Konstantin Belyavskiy [this message]
2018-07-03 13:03 ` [tarantool-patches] [PATCH v4 1/2] replication: rename thread from tx to tx_prio Konstantin Belyavskiy
2018-07-03 13:03 ` [tarantool-patches] [PATCH v4 2/2] replication: force gc to clean xdir on ENOSPC err Konstantin Belyavskiy
2018-07-04 17:23   ` [tarantool-patches] " Konstantin Osipov
2018-07-04 17:24   ` Konstantin Osipov

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=20180703130347.26296-1-k.belyavskiy@tarantool.org \
    --to=k.belyavskiy@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='Re: [tarantool-patches] [PATCH v4 0/2] force gc on running out of disk space' \
    /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