[PATCH 3/4] index: remove lsn from commit_create arguments
Vladimir Davydov
vdavydov.dev at gmail.com
Sat Mar 17 20:56:36 MSK 2018
The lsn argument of index_vtab::commit_create was introduced for the
sake of vinyl, which used it to identify indexes in vylog. Now vinyl
doesn't need it anymore so we can remove it.
---
src/box/alter.cc | 28 +++++++++++++---------------
src/box/index.cc | 2 +-
src/box/index.h | 12 ++++--------
src/box/vinyl.c | 4 +---
4 files changed, 19 insertions(+), 27 deletions(-)
diff --git a/src/box/alter.cc b/src/box/alter.cc
index 8455373b..809fb4ed 100644
--- a/src/box/alter.cc
+++ b/src/box/alter.cc
@@ -616,8 +616,7 @@ public:
struct rlist link;
virtual void alter_def(struct alter_space * /* alter */) {}
virtual void alter(struct alter_space * /* alter */) {}
- virtual void commit(struct alter_space * /* alter */,
- int64_t /* signature */) {}
+ virtual void commit(struct alter_space * /* alter */) {}
virtual void rollback(struct alter_space * /* alter */) {}
virtual ~AlterSpaceOp() {}
@@ -717,7 +716,7 @@ AlterSpaceOp::AlterSpaceOp(struct alter_space *alter)
static void
alter_space_commit(struct trigger *trigger, void *event)
{
- struct txn *txn = (struct txn *) event;
+ (void) event;
struct alter_space *alter = (struct alter_space *) trigger->data;
/*
* Commit alter ops, this will move the changed
@@ -725,7 +724,7 @@ alter_space_commit(struct trigger *trigger, void *event)
*/
class AlterSpaceOp *op;
rlist_foreach_entry(op, &alter->ops, link) {
- op->commit(alter, txn->signature);
+ op->commit(alter);
}
trigger_run_xc(&on_alter_space, alter->new_space);
@@ -919,7 +918,7 @@ public:
new_def(new_def) {}
virtual void alter(struct alter_space *alter);
virtual void alter_def(struct alter_space *alter);
- virtual void commit(struct alter_space *alter, int64_t lsn);
+ virtual void commit(struct alter_space *alter);
virtual ~ModifySpaceFormat();
};
@@ -954,10 +953,9 @@ ModifySpaceFormat::alter(struct alter_space *alter)
}
void
-ModifySpaceFormat::commit(struct alter_space *alter, int64_t lsn)
+ModifySpaceFormat::commit(struct alter_space *alter)
{
(void) alter;
- (void) lsn;
old_dict = NULL;
}
@@ -1009,7 +1007,7 @@ public:
struct index_def *old_index_def;
virtual void alter_def(struct alter_space *alter);
virtual void alter(struct alter_space *alter);
- virtual void commit(struct alter_space *alter, int64_t lsn);
+ virtual void commit(struct alter_space *alter);
};
/*
@@ -1046,7 +1044,7 @@ DropIndex::alter(struct alter_space *alter)
}
void
-DropIndex::commit(struct alter_space *alter, int64_t /* signature */)
+DropIndex::commit(struct alter_space *alter)
{
struct index *index = index_find_xc(alter->old_space,
old_index_def->iid);
@@ -1177,7 +1175,7 @@ public:
struct index_def *new_index_def;
virtual void alter_def(struct alter_space *alter);
virtual void alter(struct alter_space *alter);
- virtual void commit(struct alter_space *alter, int64_t lsn);
+ virtual void commit(struct alter_space *alter);
virtual ~CreateIndex();
};
@@ -1225,11 +1223,11 @@ CreateIndex::alter(struct alter_space *alter)
}
void
-CreateIndex::commit(struct alter_space *alter, int64_t signature)
+CreateIndex::commit(struct alter_space *alter)
{
struct index *new_index = index_find_xc(alter->new_space,
new_index_def->iid);
- index_commit_create(new_index, signature);
+ index_commit_create(new_index);
}
CreateIndex::~CreateIndex()
@@ -1263,7 +1261,7 @@ public:
struct index_def *old_index_def;
virtual void alter_def(struct alter_space *alter);
virtual void alter(struct alter_space *alter);
- virtual void commit(struct alter_space *alter, int64_t signature);
+ virtual void commit(struct alter_space *alter);
virtual ~RebuildIndex();
};
@@ -1288,14 +1286,14 @@ RebuildIndex::alter(struct alter_space *alter)
}
void
-RebuildIndex::commit(struct alter_space *alter, int64_t signature)
+RebuildIndex::commit(struct alter_space *alter)
{
struct index *old_index = space_index(alter->old_space,
old_index_def->iid);
struct index *new_index = space_index(alter->new_space,
new_index_def->iid);
index_commit_drop(old_index);
- index_commit_create(new_index, signature);
+ index_commit_create(new_index);
}
RebuildIndex::~RebuildIndex()
diff --git a/src/box/index.cc b/src/box/index.cc
index 21c768ce..006b2e9c 100644
--- a/src/box/index.cc
+++ b/src/box/index.cc
@@ -536,7 +536,7 @@ index_build(struct index *index, struct index *pk)
/* {{{ Virtual method stubs */
void
-generic_index_commit_create(struct index *, int64_t)
+generic_index_commit_create(struct index *)
{
}
diff --git a/src/box/index.h b/src/box/index.h
index 81d32a8b..07a2ba8b 100644
--- a/src/box/index.h
+++ b/src/box/index.h
@@ -344,12 +344,8 @@ struct index_vtab {
/**
* Called after WAL write to commit index creation.
* Must not fail.
- *
- * @signature is the LSN that was assigned to the row
- * that created the index. If the index was created by
- * a snapshot row, it is set to the snapshot signature.
*/
- void (*commit_create)(struct index *index, int64_t signature);
+ void (*commit_create)(struct index *index);
/**
* Called after WAL write to commit index drop.
* Must not fail.
@@ -463,9 +459,9 @@ int
index_build(struct index *index, struct index *pk);
static inline void
-index_commit_create(struct index *index, int64_t signature)
+index_commit_create(struct index *index)
{
- index->vtab->commit_create(index, signature);
+ index->vtab->commit_create(index);
}
static inline void
@@ -586,7 +582,7 @@ index_end_build(struct index *index)
/*
* Virtual method stubs.
*/
-void generic_index_commit_create(struct index *, int64_t);
+void generic_index_commit_create(struct index *);
void generic_index_commit_drop(struct index *);
void generic_index_update_def(struct index *);
ssize_t generic_index_size(struct index *);
diff --git a/src/box/vinyl.c b/src/box/vinyl.c
index 244360fa..9b5c7e08 100644
--- a/src/box/vinyl.c
+++ b/src/box/vinyl.c
@@ -775,10 +775,8 @@ vy_index_open(struct vy_env *env, struct vy_index *index)
}
static void
-vinyl_index_commit_create(struct index *base, int64_t lsn)
+vinyl_index_commit_create(struct index *base)
{
- (void)lsn;
-
struct vy_env *env = vy_env(base->engine);
struct vy_index *index = vy_index(base);
--
2.11.0
More information about the Tarantool-patches
mailing list