Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tarantool does not start: Tuple field 6 type does not match... #2950

Closed
stepan-mitkin opened this issue Nov 23, 2017 · 12 comments
Closed

tarantool does not start: Tuple field 6 type does not match... #2950

stepan-mitkin opened this issue Nov 23, 2017 · 12 comments
Assignees
Labels

Comments

@stepan-mitkin
Copy link

tarantool server does not start

This is a catastrophe. Please help.

How it happened:

  1. Stop tarantool using tarantoolctl
  2. Start tarantool using tarantoolctl
  3. tarantool refuses to start.

No modifications to the schema have been made recently.

Here is the log:

2017-11-23 21:29:42.436 [2633] main/101/dbg.lua I> systemd: NOTIFY_SOCKET variable is empty, skipping
2017-11-23 21:29:42.436 [2633] main/101/dbg.lua C> Tarantool 1.7.6-9-g4e960f7
2017-11-23 21:29:42.436 [2633] main/101/dbg.lua C> log level 5
2017-11-23 21:29:42.436 [2633] main/101/dbg.lua I> mapping 268435456 bytes for memtx tuple arena...
2017-11-23 21:29:42.484 [2633] main/101/dbg.lua I> mapping 134217728 bytes for vinyl tuple arena...
2017-11-23 21:29:42.486 [2633] iproto/101/main I> binary: bound to 0.0.0.0:3301
2017-11-23 21:29:42.487 [2633] main/101/dbg.lua I> recovery start
2017-11-23 21:29:42.487 [2633] main/101/dbg.lua I> recovering from `/dewt/data/00000000000006562404.snap'
2017-11-23 21:29:42.519 [2633] main/101/dbg.lua key_def.h:343 E> ER_FIELD_TYPE: Tuple field 6 type does not match one required by operation: expected string
2017-11-23 21:29:42.519 [2633] main/101/dbg.lua F> can't initialize storage: Tuple field 6 type does not match one required by operation: expected string
@stepan-mitkin
Copy link
Author

Let me explain what "does not start" means in practice.
It means:

  1. All data is lost forever.
  2. The application does not work anymore.

This is the worst thing that can happen to a database

Thanks God it happened in the test environment, not in production.
But currently, if the production server stops, it will stop forever.

@stepan-mitkin
Copy link
Author

I did some debugging. Here is what the stack looks like:

tuple_validate_raw (i == 5)
tuple_validate
memtx_space_check_format (the space name is "_space")
space_check_format_xc
ModifySpace::alter
alter_space_do
on_replace_dd_space

@kostja
Copy link
Contributor

kostja commented Nov 27, 2017

First, please, this is not a data loss, this looks like an upgrade issue. Beginning with 1.7.6 we started to enforce space:format data types, so if you have a string column in space:format, you won't be able to insert a number in it.

Please downgrade to the original version you used, fix the conflicting data or remove space formatting, then you should be able to upgrade OK.

@kostja
Copy link
Contributor

kostja commented Nov 27, 2017

You could also use 'force_recovery' to skip the offending tuple, but it is of course the last resort.

@stepan-mitkin
Copy link
Author

First, please, this is not a data loss, this looks like an upgrade issue.

Huff... Thanks.

fix the conflicting data or remove space formatting

It's not data. It's metadata. A description of spaces in the database. The space name that tarantool complains on is "_space".

So 'force_recovery' does not help. I end up with an empty database if I use 'force_recovery'.
I'll try to downgrade and see what happens.

@stepan-mitkin
Copy link
Author

Downgrade to 1.7.5 did not work.

2017-11-27 21:15:23.531 [16508] main/101/dbg.lua I> recovery start
2017-11-27 21:15:23.531 [16508] main/101/dbg.lua I> recovering from `/home/stipan/tmp/tara//00000000000093350726.snap'
2017-11-27 21:15:23.555 [16508] main/101/dbg.lua schema.h:184 E> ER_NO_SUCH_SPACE: Space '276' does not exist
2017-11-27 21:15:23.555 [16508] main/101/dbg.lua F> can't initialize storage: Space '276' does not exist

this is not a data loss, this looks like an upgrade issue.

This is an upgrade issue that lead to a data loss.

@alyapunov
Copy link
Contributor

alyapunov commented Nov 27, 2017 via email

@Gerold103
Copy link
Collaborator

Gerold103 commented Nov 27, 2017

It seems like you store in options of one of your spaces some data not allowed by a format. Can you please show your _space content? (You said, that you still have the same schema working on a production). It can be done by box.space._space:select{}.

@Gerold103
Copy link
Collaborator

I right now had tried to run 1.7.5 from 1.7.6 snapshot using force_recovery = true, and it has started ok.

@Gerold103
Copy link
Collaborator

Write me in the Telegram (@Gerold103). I have wrote a script that can help.

@stepan-mitkin
Copy link
Author

stepan-mitkin commented Nov 29, 2017

The script helped. Thanks a lot!
Here is the script.
Run tarantool 1.7.5 with this:

box.cfg{force_recovery = true}

box.space._index:run_triggers(false)
box.space._space:run_triggers(false)

box.space._index:delete{276, 1}
box.space._index:delete{276, 0}
box.space._space:delete{276}
box.space._priv:delete{2, 'space', 276}

box.space._index:delete{284, 2}
box.space._index:delete{284, 1}
box.space._index:delete{284, 0}
box.space._space:delete{284}

box.space._index:delete{285, 0}
box.space._space:delete{285}

box.space._index:delete{340, 1}
box.space._index:delete{340, 0}
box.space._space:delete{340}

box.space._index:delete{330, 0}
box.space._space:delete{330}

box.space._schema:replace{'version', 1,7,4}
box.snapshot()

Stop tarantool.
Run tarantool 1.7.6 from that snapshot.
box.cfg { ... }
box.schema.upgrade()

@stepan-mitkin
Copy link
Author

stepan-mitkin commented Nov 29, 2017

Here is how I will upgrade tarantool from now on:

  1. Upgrade tarantool.
  2. Stop tarantool.
  3. Run tarantool with only this script
box.cfg { ... }
box.schema.upgrade()
  1. Stop tarantool
  2. Start tarantool with the normal application scripts.

Any deviation from this scenario may lead to upgrade issues.

@Gerold103 Gerold103 self-assigned this Nov 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants