[PATCH] Send relay heartbeat if wal changes won't be send

Konstantin Osipov kostja at tarantool.org
Wed Feb 28 00:28:03 MSK 2018


* Vladimir Davydov <vdavydov.dev at gmail.com> [18/02/27 12:23]:

> > +		/* Update timeout. */
> > +		coio_timeout_update(start, &timeout);
> > +		/*
> > +		 * Reset timeout if there are changes from any other
> > +		 * that current peer instance.
> > +		 */
> > +		if (relay->replica->id &&
> > +		    vclock_sum(&r->vclock) - vclock_sum(&old_vclock) >
> > +		    vclock_get(&r->vclock, relay->replica->id) -
> > +		    vclock_get(&old_vclock, relay->replica->id))
> > +			coio_timeout_init(&start, &timeout, replication_timeout);
> > +		if (timeout < 0) {
> > +			/* It is time to send heartbeat. */
> > +			relay_send_heartbeat(relay);
> > +			coio_timeout_init(&start, &timeout, replication_timeout);
> > +		}
> 
> I don't like these checks, because they duplicate the check from
> relay_send. May be, we could keep track of the time when the last
> row was sent (in relay_send), and use something like this

I agree.

Please fix the patch according to the review. Please pull the
branch before you update, I rebased it.

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



More information about the Tarantool-patches mailing list