[PATCH v2 4/4] wal: delete old wal files when running out of disk space

Vladimir Davydov vdavydov.dev at gmail.com
Wed Oct 24 12:51:16 MSK 2018

On Tue, Oct 23, 2018 at 09:46:45PM +0300, Konstantin Osipov wrote:
> * Vladimir Davydov <vdavydov.dev at gmail.com> [18/10/23 20:30]:
> > +static void
> > +gc_process_wal_event(struct wal_watcher_msg *msg)
> > +{
> > +	if ((msg->events & WAL_EVENT_GC) == 0)
> > +		return;
> GC is now subscribed to all events only to react to those *gc*
> events which delete wal files in case of emergency.
> Shouldn't gc ignore wal gc events which were initiated by
> wal_collect_garbage() at least?
> Why send wal_event_gc for these events?

Well, we could pass a mask of events a subscriber is interested in.
Come to think of it, this would look better IMO.

> wal watcher api is an artefact from the times when we had no
> cbus connection between wal and tx.

No, this isn't true. WAL watcher was introduced as a generic
notification channel built over cbus in the first place. Before
it was made available, we used inotify to track WAL directory
changes in relays.

> Now you can send a direct message to gc. Why use wal watcher api at
> all?

Because we already have a generic abstraction, and I think we'd better
use it instead of adding another wal-tx pipe to the wal_thread and
implementing home-brewed notifications on top of it.

More information about the Tarantool-patches mailing list