From fac9656809eebe89ca43f642f8e4affbed41abf9 Mon Sep 17 00:00:00 2001 From: Vladimir Davydov <vdavydov.dev@gmail.com> Date: Sun, 1 Apr 2018 09:06:52 +0300 Subject: [PATCH] vinyl: zap vy_lsm_validate_formats We allocate index formats in the only place, vy_lsm_new, so there's no point in this debug-only check anymore. --- src/box/vinyl.c | 2 -- src/box/vy_lsm.c | 25 ------------------------- src/box/vy_lsm.h | 7 ------- 3 files changed, 34 deletions(-) diff --git a/src/box/vinyl.c b/src/box/vinyl.c index 4d27cc3d57..ea01857a18 100644 --- a/src/box/vinyl.c +++ b/src/box/vinyl.c @@ -1027,7 +1027,6 @@ vinyl_space_commit_alter(struct space *old_space, struct space *new_space) assert(pk->pk == NULL); pk->check_is_unique = true; - vy_lsm_validate_formats(pk); key_def_update_optionality(pk->key_def, new_format->min_field_count); key_def_update_optionality(pk->cmp_def, new_format->min_field_count); @@ -1041,7 +1040,6 @@ vinyl_space_commit_alter(struct space *old_space, struct space *new_space) new_format->min_field_count); key_def_update_optionality(lsm->cmp_def, new_format->min_field_count); - vy_lsm_validate_formats(lsm); } /* diff --git a/src/box/vy_lsm.c b/src/box/vy_lsm.c index 4b2c3ef303..6cb722f449 100644 --- a/src/box/vy_lsm.c +++ b/src/box/vy_lsm.c @@ -52,30 +52,6 @@ #include "vy_upsert.h" #include "vy_read_set.h" -void -vy_lsm_validate_formats(const struct vy_lsm *lsm) -{ - (void) lsm; - assert(lsm->disk_format != NULL); - assert(lsm->mem_format != NULL); - assert(lsm->mem_format_with_colmask != NULL); - uint32_t index_field_count = lsm->mem_format->index_field_count; - (void) index_field_count; - if (lsm->index_id == 0) { - assert(lsm->disk_format == lsm->mem_format); - assert(lsm->disk_format->index_field_count == - index_field_count); - assert(lsm->mem_format_with_colmask->index_field_count == - index_field_count); - } else { - assert(lsm->disk_format != lsm->mem_format); - assert(lsm->disk_format->index_field_count <= - index_field_count); - } - assert(lsm->mem_format_with_colmask->index_field_count == - index_field_count); -} - int vy_lsm_env_create(struct vy_lsm_env *env, const char *path, int64_t *p_generation, @@ -232,7 +208,6 @@ vy_lsm_new(struct vy_lsm_env *lsm_env, struct vy_cache_env *cache_env, vy_lsm_read_set_new(&lsm->read_set); lsm_env->lsm_count++; - vy_lsm_validate_formats(lsm); return lsm; fail_mem: diff --git a/src/box/vy_lsm.h b/src/box/vy_lsm.h index ab54da752f..f5862a5264 100644 --- a/src/box/vy_lsm.h +++ b/src/box/vy_lsm.h @@ -286,13 +286,6 @@ struct vy_lsm { vy_lsm_read_set_t read_set; }; -/** - * Assert if an LSM tree formats are inconsistent. - * @param lsm LSM tree to validate. - */ -void -vy_lsm_validate_formats(const struct vy_lsm *lsm); - /** Return LSM tree name. Used for logging. */ const char * vy_lsm_name(struct vy_lsm *lsm); -- GitLab