[tarantool-patches] Re: [PATCH 5/9] gc: do not use WAL watcher API for deactivating stale consumers

Konstantin Osipov kostja at tarantool.org
Thu Nov 29 20:02:42 MSK 2018


* Vladimir Davydov <vdavydov.dev at gmail.com> [18/11/28 19:16]:
> The WAL thread may delete old WAL files if it gets ENOSPC error.
> Currently, we use WAL watcher API to notify the TX thread about it so
> that it can shoot off stale replicas. This looks ugly, because WAL
> watcher API was initially designed to propagate WAL changes to relay
> threads and the new event WAL_EVENT_GC, which was introduced for
> notifying about ENOSPC-driven garbage collection, isn't used anywhere
> else. Besides, there's already a pipe from WAL to TX - we could reuse it
> instead of opening another one.
> 
> If we followed down that path, then in order to trigger a checkpoint
> from the WAL thread (see #1082), we would have to introduce yet another
> esoteric WAL watcher event, making the whole design look even uglier.
> That said, let's rewrite the garbage collection notification procedure
> using a plane callback instead of abusing WAL watcher API.

Thank you for the patch. As discussed, let's avoid invoking
garbage collection from txn.cc, WAL can alert tx explicitly
whenever an exceptional situation such as ENOSPC happens.


> +	/**
> +	 * Set if the WAL thread ran out of disk space while
> +	 * processing this request and had to delete some old
> +	 * WAL files.
> +	 */
> +	bool gc_executed;

This will be unnecessary if we send a special message.

If you are worried about OOM when creating such a message, you
could
a) ignore the message
b) use a preallocated one, stored in struct wal.

-- 
Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
http://tarantool.io - www.twitter.com/kostja_osipov




More information about the Tarantool-patches mailing list