[PATCH] applier: stop sending ACKs if master closed socket

Vladimir Davydov vdavydov.dev at gmail.com
Tue Jan 30 16:41:20 MSK 2018


On Tue, Jan 30, 2018 at 03:47:20PM +0300, Konstantin Osipov wrote:
> * Vladimir Davydov <vdavydov.dev at gmail.com> [18/01/30 13:54]:
> > 
> > Hmm, how do we define "batch" in applier?
> 
> Please take a look at coio_read_xrow. It performs a buffered read.
> But we parse one row at a time. We could try to parse entire batch
> at once, sending one ack per entire buffer. Or we could
> 'lookahead' parse the next row before sending the ack.

Makes sense, as a separate optimization, but I don't think it would help
against the issue I'm trying to fix here - spamming the log in case the
master closes the socket end used for reading ACKs. It would, of course,
reduce the number of EPIPE errors generated, but it wouldn't limit it in
general (row size may vary), so we would get say hundreds of error
messages instead of thousands, but it is still too many.

> 
> > Generally, I agree that it is an overkill to send an ACK per each
> > applied request, but I don't know how to fix it right. I see the
> > following options:
> > 
> >  - Rate limit ACKs, say only send an ACK once per
> >    replication_timeout tops.
> > 
> >  - Send an ACK once per N messages/bytes. What should N be?
> >    If N is not big enough, we will still get quite a lot of
> >    error messages from the writer fiber though.
> > 
> >  - Do not send an ACK until the socket is empty
> >    (use ioctl(FIONREAD) to detect it?)



More information about the Tarantool-patches mailing list