Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladimir Davydov <vdavydov.dev@gmail.com>
To: kostja@tarantool.org
Cc: tarantool-patches@freelists.org
Subject: [PATCH 3/4] index: remove lsn from commit_create arguments
Date: Sat, 17 Mar 2018 20:56:36 +0300	[thread overview]
Message-ID: <de977684ed2a815e856aae32715896fcf0e2eea5.1521306336.git.vdavydov.dev@gmail.com> (raw)
In-Reply-To: <cover.1521306336.git.vdavydov.dev@gmail.com>
In-Reply-To: <cover.1521306336.git.vdavydov.dev@gmail.com>

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

  parent reply	other threads:[~2018-03-17 17:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-17 17:56 [PATCH 0/4] Prepare vylog for space alter Vladimir Davydov
2018-03-17 17:56 ` [PATCH 1/4] vinyl: refactor vylog recovery Vladimir Davydov
2018-03-17 17:56 ` [PATCH 2/4] vinyl: do not use index lsn to identify indexes in vylog Vladimir Davydov
2018-03-19 15:01   ` Vladimir Davydov
2018-03-17 17:56 ` Vladimir Davydov [this message]
2018-03-17 17:56 ` [PATCH 4/4] alter: rewrite space truncation using alter infrastructure Vladimir Davydov

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=de977684ed2a815e856aae32715896fcf0e2eea5.1521306336.git.vdavydov.dev@gmail.com \
    --to=vdavydov.dev@gmail.com \
    --cc=kostja@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='Re: [PATCH 3/4] index: remove lsn from commit_create arguments' \
    /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