[PATCH v2 4/5] vinyl: do not use index lsn to identify indexes in vylog

Vladimir Davydov vdavydov.dev at gmail.com
Thu Mar 22 18:08:35 MSK 2018


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:



More information about the Tarantool-patches mailing list