[Tarantool-patches] [tarantool-patches] [PATCH v4 1/4] box: add an ability to disable CK constraints

Nikita Pettik korablev at tarantool.org
Mon Oct 14 19:49:11 MSK 2019


On 08 Oct 16:02, Kirill Shcherbatov wrote:
> Now it is possible to disable and enable ck constraints in LUA.
> This option is persistent. All ck constraints are constructed
> in enabled state when Tarantool is configured. This ability
> may be useful when all information processed is (by some reason)

-> when processed data is verified and constraints validation
is not required. For instance, during casual recovery process there's
no need to provide any checks since data is assumed to be consistent.

Also explain why we have to store this option.

> trusted and ck constraints validations are not required.
> 
> Part of #4244
> ---
>  src/box/alter.cc             |  31 ++++++--
>  src/box/bootstrap.snap       | Bin 5934 -> 5944 bytes
>  src/box/ck_constraint.c      |   7 +-
>  src/box/ck_constraint.h      |   8 +-
>  src/box/lua/schema.lua       |  16 +++-
>  src/box/lua/space.cc         |   3 +
>  src/box/lua/upgrade.lua      |  13 ++++
>  src/box/schema_def.h         |   1 +
>  src/box/sql/build.c          |  11 +--
>  test/box-py/bootstrap.result |   3 +-
>  test/box/access_misc.result  | 137 ++++++++++++++++++-----------------
>  test/sql/checks.result       | 108 ++++++++++++++++++++++-----
>  test/sql/checks.test.lua     |  57 ++++++++++-----
>  test/sql/errinj.result       |  12 +--
>  test/sql/errinj.test.lua     |  12 +--
>  15 files changed, 286 insertions(+), 133 deletions(-)

To be honest, I doubt that 'is_enable' option should be persisted..
At least, we can assume that it is always 'on' by default, so that
save user from having to specify this option each time.

> diff --git a/src/box/bootstrap.snap b/src/box/bootstrap.snap
> index 4c9aea7f50f8ac86be32ca9f126fea9a3d2d182f..59f6cc16bb48841fa99b4e13590b8e0677433b35 100644
> GIT binary patch
> delta 4861
> 
> diff --git a/src/box/ck_constraint.c b/src/box/ck_constraint.c
> index 1cde27022..fafa7be12 100644
> --- a/src/box/ck_constraint.c
> +++ b/src/box/ck_constraint.c
> @@ -223,6 +225,7 @@ ck_constraint_new(struct ck_constraint_def *ck_constraint_def,
>  	}
>  	ck_constraint->def = NULL;
>  	ck_constraint->stmt = NULL;
> +

Extra diff.



More information about the Tarantool-patches mailing list