From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Thu, 22 Mar 2018 18:08:35 +0300 From: Vladimir Davydov Subject: Re: [PATCH v2 4/5] vinyl: do not use index lsn to identify indexes in vylog Message-ID: <20180322150835.tkn2twkxu2mghkj6@esperanza> References: <3bb507af569820382ddf2cce1e776e9d13f1ec91.1521545062.git.vdavydov.dev@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3bb507af569820382ddf2cce1e776e9d13f1ec91.1521545062.git.vdavydov.dev@gmail.com> To: kostja@tarantool.org Cc: tarantool-patches@freelists.org List-ID: On Tue, Mar 20, 2018 at 02:29:04PM +0300, Vladimir Davydov wrote: > diff --git a/src/box/vy_log.c b/src/box/vy_log.c > index a6f03a55..9c8dd631 100644 > --- a/src/box/vy_log.c > +++ b/src/box/vy_log.c > @@ -2013,7 +2048,7 @@ vy_log_append_index(struct xlog *xlog, struct vy_index_recovery_info *index) > > vy_log_record_init(&record); > record.type = VY_LOG_CREATE_INDEX; > - record.index_lsn = index->index_lsn; > + record.index_id = index->id; > record.index_def_id = index->index_id; > record.space_def_id = index->space_id; > record.key_parts = index->key_parts; Missed setting record.commit_lsn here - fixed on branch: diff --git a/src/box/vy_log.c b/src/box/vy_log.c index 0a5dd26e..ea4b902d 100644 --- a/src/box/vy_log.c +++ b/src/box/vy_log.c @@ -2012,6 +2012,7 @@ vy_log_append_index(struct xlog *xlog, struct vy_index_recovery_info *index) record.space_def_id = index->space_id; record.key_parts = index->key_parts; record.key_part_count = index->key_part_count; + record.commit_lsn = index->commit_lsn; if (vy_log_append_record(xlog, &record) != 0) return -1; diff --git a/test/vinyl/layout.result b/test/vinyl/layout.result index f1f52b9f..8878cb5e 100644 --- a/test/vinyl/layout.result +++ b/test/vinyl/layout.result @@ -128,7 +128,8 @@ result - - HEADER: type: INSERT BODY: - tuple: [0, {7: [{'field': 0, 'collation': 1, 'type': 'string'}], 6: 512}] + tuple: [0, {7: [{'field': 0, 'collation': 1, 'type': 'string'}], 12: 3, + 6: 512}] - HEADER: type: INSERT BODY: @@ -156,7 +157,8 @@ result - HEADER: type: INSERT BODY: - tuple: [0, {0: 2, 5: 1, 6: 512, 7: [{'field': 1, 'is_nullable': true, 'type': 'unsigned'}]}] + tuple: [0, {0: 2, 5: 1, 6: 512, 7: [{'field': 1, 'is_nullable': true, 'type': 'unsigned'}], + 12: 4}] - HEADER: type: INSERT BODY: