Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladimir Davydov <vdavydov.dev@gmail.com>
To: tarantool-patches@freelists.org
Subject: Re: [PATCH 2/9] vinyl: ignore unknown .run, .index and .vylog keys
Date: Thu, 24 Jan 2019 19:56:04 +0300	[thread overview]
Message-ID: <20190124165604.skr4ipxpwq3qdbr2@esperanza> (raw)
In-Reply-To: <828fd6243abcca2c09e532f50da88e254775cdef.1548017258.git.vdavydov.dev@gmail.com>

On Mon, Jan 21, 2019 at 12:17:01AM +0300, Vladimir Davydov wrote:
> Currently, if we encounter an unknown key while parsing a .run, .index,
> or .vylog file we raise an error. As a result, if we add a new key to
> either of those entities, we will break forward compatibility although
> there's actually no reason for that. To avoid that, let's silently
> ignore unknown keys, as we do in case of xrow header keys.
> ---
>  src/box/vy_log.c |  9 ++-------
>  src/box/vy_run.c | 12 ++++--------
>  2 files changed, 6 insertions(+), 15 deletions(-)
> 
> diff --git a/src/box/vy_log.c b/src/box/vy_log.c
> index c9e0713c..d3fa0c7a 100644
> --- a/src/box/vy_log.c
> +++ b/src/box/vy_log.c
> @@ -620,14 +620,9 @@ vy_log_record_decode(struct vy_log_record *record,
>  		case VY_LOG_KEY_GC_LSN:
>  			record->gc_lsn = mp_decode_uint(&pos);
>  			break;
> -		case VY_LOG_KEY_TRUNCATE_COUNT:
> -			/* Not used anymore, ignore. */
> -			break;
>  		default:
> -			diag_set(ClientError, ER_INVALID_VYLOG_FILE,
> -				 tt_sprintf("Bad record: unknown key %u",
> -					    (unsigned)key));
> -			goto fail;
> +			mp_next(&pos); /* unknown key, ignore */
> +			break;
>  		}
>  	}
>  	if (record->type == VY_LOG_CREATE_LSM) {
> diff --git a/src/box/vy_run.c b/src/box/vy_run.c
> index d82f1e37..cee90458 100644
> --- a/src/box/vy_run.c
> +++ b/src/box/vy_run.c
> @@ -524,10 +524,8 @@ vy_page_info_decode(struct vy_page_info *page, const struct xrow_header *xrow,
>  			page->row_index_offset = mp_decode_uint(&pos);
>  			break;
>  		default:
> -			diag_set(ClientError, ER_INVALID_INDEX_FILE, filename,
> -				 tt_sprintf("Can't decode page info: "
> -					    "unknown key %u", (unsigned)key));
> -			return -1;
> +			mp_next(&pos); /* unknown key, ignore */
> +			break;
>  		}
>  	}
>  	if (key_map) {
> @@ -634,10 +632,8 @@ vy_run_info_decode(struct vy_run_info *run_info,
>  			vy_stmt_stat_decode(&run_info->stmt_stat, &pos);
>  			break;
>  		default:
> -			diag_set(ClientError, ER_INVALID_INDEX_FILE, filename,
> -				"Can't decode run info: unknown key %u",
> -				(unsigned)key);
> -			return -1;
> +			mp_next(&pos); /* unknown key, ignore */
> +			break;
>  		}
>  	}
>  	if (key_map) {

This one is trivial and should raise no questions.
I pushed it to 2.1 and 1.10.

  reply	other threads:[~2019-01-24 16:56 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-20 21:16 [PATCH 0/9] vinyl: compaction randomization and throttling Vladimir Davydov
2019-01-20 21:17 ` [PATCH 1/9] vinyl: update lsm->range_heap in one go on dump completion Vladimir Davydov
2019-01-24 16:55   ` Vladimir Davydov
2019-02-05 16:37   ` [tarantool-patches] " Konstantin Osipov
2019-01-20 21:17 ` [PATCH 2/9] vinyl: ignore unknown .run, .index and .vylog keys Vladimir Davydov
2019-01-24 16:56   ` Vladimir Davydov [this message]
2019-01-20 21:17 ` [PATCH 3/9] vinyl: use uncompressed run size for range split/coalesce/compaction Vladimir Davydov
2019-01-21  9:42   ` Vladimir Davydov
2019-02-05 16:49     ` [tarantool-patches] " Konstantin Osipov
2019-02-06  8:55       ` Vladimir Davydov
2019-02-06 10:46         ` Konstantin Osipov
2019-02-06 10:55           ` Vladimir Davydov
2019-02-05 16:43   ` Konstantin Osipov
2019-02-06 16:48     ` Vladimir Davydov
2019-01-20 21:17 ` [PATCH 4/9] vinyl: rename lsm->range_heap to max_compaction_priority Vladimir Davydov
2019-01-20 21:17 ` [PATCH 5/9] vinyl: keep track of dumps per compaction for each LSM tree Vladimir Davydov
2019-02-05 16:58   ` [tarantool-patches] " Konstantin Osipov
2019-02-06  9:20     ` Vladimir Davydov
2019-02-06 16:54       ` Vladimir Davydov
2019-01-20 21:17 ` [PATCH 6/9] vinyl: set range size automatically Vladimir Davydov
2019-01-22  9:17   ` Vladimir Davydov
2019-02-05 17:09   ` [tarantool-patches] " Konstantin Osipov
2019-02-06  9:23     ` Vladimir Davydov
2019-02-06 17:04       ` Vladimir Davydov
2019-01-20 21:17 ` [PATCH 7/9] vinyl: randomize range compaction to avoid IO load spikes Vladimir Davydov
2019-01-22 12:54   ` Vladimir Davydov
2019-02-05 17:39     ` [tarantool-patches] " Konstantin Osipov
2019-02-06  8:53       ` Vladimir Davydov
2019-02-06 10:44         ` Konstantin Osipov
2019-02-06 10:52           ` Vladimir Davydov
2019-02-06 11:06             ` Konstantin Osipov
2019-02-06 11:49               ` Vladimir Davydov
2019-02-06 13:43                 ` Konstantin Osipov
2019-02-06 14:00                   ` Vladimir Davydov
2019-02-05 17:14   ` Konstantin Osipov
2019-01-20 21:17 ` [PATCH 8/9] vinyl: introduce quota consumer types Vladimir Davydov
2019-01-20 21:17 ` [PATCH 9/9] vinyl: throttle tx to ensure compaction keeps up with dumps Vladimir Davydov
2019-01-21 14:14   ` Vladimir Davydov
2019-01-22  9:09   ` 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=20190124165604.skr4ipxpwq3qdbr2@esperanza \
    --to=vdavydov.dev@gmail.com \
    --cc=tarantool-patches@freelists.org \
    --subject='Re: [PATCH 2/9] vinyl: ignore unknown .run, .index and .vylog keys' \
    /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