From: Vladimir Davydov <vdavydov.dev@gmail.com>
To: kostja@tarantool.org
Cc: tarantool-patches@freelists.org
Subject: [PATCH 06/12] vinyl: zap vy_lsm_validate_formats
Date: Sun, 1 Apr 2018 12:05:33 +0300 [thread overview]
Message-ID: <afe35409e1cc930b2583dc0562764e8dd76056c1.1522572161.git.vdavydov.dev@gmail.com> (raw)
In-Reply-To: <cover.1522572160.git.vdavydov.dev@gmail.com>
In-Reply-To: <cover.1522572160.git.vdavydov.dev@gmail.com>
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 f3cef52f..145fde70 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 4b2c3ef3..6cb722f4 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 ab54da75..f5862a52 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);
--
2.11.0
next prev parent reply other threads:[~2018-04-01 9:05 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-01 9:05 [PATCH 00/12] vinyl: allow to extend key def of non-empty index Vladimir Davydov
2018-04-01 9:05 ` [PATCH 01/12] index: add commit_modify virtual method Vladimir Davydov
2018-04-01 9:05 ` [PATCH 02/12] alter: require rebuild of all secondary vinyl indexes if pk changes Vladimir Davydov
2018-04-01 9:05 ` [PATCH 03/12] alter: do not rebuild secondary indexes on compatible " Vladimir Davydov
2018-04-05 12:30 ` Konstantin Osipov
2018-04-01 9:05 ` [PATCH 04/12] space: make space_swap_index method virtual Vladimir Davydov
2018-04-01 9:05 ` [PATCH 05/12] vinyl: do not reallocate tuple formats on alter Vladimir Davydov
2018-04-01 11:12 ` [tarantool-patches] " v.shpilevoy
2018-04-01 11:24 ` Vladimir Davydov
2018-04-01 9:05 ` Vladimir Davydov [this message]
2018-04-01 9:05 ` [PATCH 07/12] vinyl: zap vy_mem_update_formats Vladimir Davydov
2018-04-01 9:05 ` [PATCH 08/12] vinyl: remove pointless is_nullable initialization for disk_format Vladimir Davydov
2018-04-01 9:05 ` [PATCH 09/12] vinyl: use source tuple format when copying field map Vladimir Davydov
2018-04-01 9:05 ` [PATCH 10/12] vinyl: rename vy_log_record::commit_lsn to create_lsn Vladimir Davydov
2018-04-01 9:05 ` [PATCH 11/12] vinyl: do not write VY_LOG_DUMP_LSM record to snapshot Vladimir Davydov
2018-04-01 9:05 ` [PATCH 12/12] vinyl: allow to modify key definition if it does not require rebuild Vladimir Davydov
2018-04-02 8:46 ` Vladimir Davydov
2018-04-05 14:32 ` Konstantin Osipov
2018-04-05 14:45 ` Konstantin Osipov
2018-04-05 14:48 ` Konstantin Osipov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=afe35409e1cc930b2583dc0562764e8dd76056c1.1522572161.git.vdavydov.dev@gmail.com \
--to=vdavydov.dev@gmail.com \
--cc=kostja@tarantool.org \
--cc=tarantool-patches@freelists.org \
--subject='Re: [PATCH 06/12] vinyl: zap vy_lsm_validate_formats' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox