[tarantool-patches] [PATCH] replication: automatic skip duplicating rows in replication

Konstantin Osipov kostja at tarantool.org
Sat Apr 28 23:13:24 MSK 2018


* Konstantin Belyavskiy <k.belyavskiy at tarantool.org> [18/04/13 16:45]:

Konstantin, checking the configuration option for every
conflicting row is too much overhead.

Please instead implement a trigger which would push any change in
box.cfg to a global variable in replication module. 

> -			xstream_write_xc(applier->subscribe_stream, &row);
> +			if (xstream_write(applier->subscribe_stream, &row) != 0) {
> +				struct error *e = diag_last_error(diag_get());
> +				/**
> +				 * Silently skip ER_TUPLE_FOUND error if such
> +				 * option is set in config.
> +				 */
> +				if (e->type == &type_ClientError &&
> +				    box_error_code(e) == ER_TUPLE_FOUND &&
> +				    cfg_geti("replication_skip_conflict"))
> +					diag_clear(diag_get());
> +				else
> +					diag_raise();
> +			}

I'm talking about this bit.

Thanks!

-- 
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