[tarantool-patches] Re: [PATCH v4 3/4] box: do not evaluate ck constraints on recovery

Konstantin Osipov kostja.osipov at gmail.com
Sun Oct 13 15:51:09 MSK 2019


* Kirill Shcherbatov <kshcherbatov at tarantool.org> [19/10/08 16:06]:
> +#include "memtx_engine.h"

Please add an engine wrapper around memtx_engine.h

engine.h:

engine_is_force_recovery() {
    return memtx_engine->snap_dir.is_force_recovery;
}
> +	/**
> +	 * Dispite ck_constraint_def::is_enabled property this
> +	 * option defines a state of the runtine ck constraint
> +	 * object and may be overriden manually.

overridden

> +	 */
> +	bool is_enabled;
> --- a/src/box/engine.c
> +++ b/src/box/engine.c
> @@ -32,6 +32,9 @@
>  
>  #include <stdint.h>
>  #include <string.h>
> +#include "schema.h"
> +#include "trigger.h"
> +#include "ck_constraint.h"
>  #include <small/rlist.h>
> +static int
> +space_enable_ck_constraints(struct space *space, void *param)
> +{
> +	(void) param;
> +	struct ck_constraint *ck;
> +	rlist_foreach_entry(ck, &space->ck_constraint, link)
> +		ck->is_enabled = ck->def->is_enabled;
> +	(void) trigger_run(&on_alter_space, space);
> +	return 0;
> +}

Having to add 3 header files for 3 lines of code should raise a
flag.

Why do you define this method in engine.h? Can you define it
elsewhere so that there are fewer dependencies? schema.h? space.h?


-- 
Konstantin Osipov, Moscow, Russia




More information about the Tarantool-patches mailing list