-
Notifications
You must be signed in to change notification settings - Fork 711
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
RQG tests failed with "Got error 122 from storage engine" error #238
Comments
@dleeyh : Could you paste the exact rqg command you reproduced? |
|
@dleeyh can you check if #239 resolved this issue |
I debugged and it failed at myrocks::ha_rocksdb::convert_record_from_storage_format().
it->skip was 282, and reader->m_len was 281. reader.read() returned nullptr because m_len was smaller than the argument, so the function returned HA_ERR_INTERNAL_ERROR. |
I think I've found the problem. The field_decoders code, which allows us to skip over fields that we don't need to decode, doesn't handle NULL fields in the skipped data correctly. I can reproduce the 'Got error 122 from storage engine' with this simple script.
I'm very surprised none of our existing tests select specific columns where earlier columns are NULL. I'll work on a fix for this. |
Summary: The MyRocks code has some field_decoders structures that allow columns that are not needed to not be decoded when converting from the on-disk data format to the MySQL in-memory format. These were not set up correctly when nullable columns were part of the row and would cause us to attempt to skip too many bytes in the row - causing either incorrect data or an error indicating corruption. (Issue #238) Squash with: https://reviews.facebook.net/D56115 Test Plan: Updated rocksdb.col_opt_null to add a query that fails with the old code and verified that it succeeded with the new code. Reviewers: hermanlee4, yoshinorim, spetrunia Reviewed By: spetrunia Subscribers: webscalesql-eng Differential Revision: https://reviews.facebook.net/D57633
Build tested:
myrocks@rocksdb:~/builds/reptest/mysql-5.6$ git show
commit e4f22e0
Author: Jay Edgar jkedgar@fb.com
Date: Wed Apr 6 12:48:20 2016 -0700
The following statements returned a storage error. In turn, RQG reports a database corruption error:
#2016-04-28T14:28:38 [44278] Test completed with failure status STATUS_DATABASE_CORRUPTION (105)
mysql> SELECT
col_enum_utf8
FROMtable1_int_autoinc
WHERE 1 = 1;ERROR 1030 (HY000): Got error 122 from storage engine
mysql> INSERT INTO
table100_key_pk_parts_2_int_autoinc
(col_int_key
,col_int
) SELECTcol_int
,col_int_key
FROMtable100_int_autoinc
WHEREpk
> 10 LIMIT 3;ERROR 1030 (HY000): Got error 122 from storage engine
mysql> desc table1_int_autoinc;
+-------------------------------------+---------------------------------------------------------------------------------------------------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------------------------------+---------------------------------------------------------------------------------------------------------------+------+-----+---------+----------------+
| col_enum_latin1_key | enum('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') | YES | MUL | NULL | |
| col_datetime_key_default_null | datetime | YES | MUL | NULL | |
| col_int_default_null | int(11) | YES | | NULL | |
| col_enum_utf8_key_default_null | enum('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') | YES | MUL | NULL | |
| col_int_unsigned_key | int(10) unsigned | YES | MUL | NULL | |
| col_int_unsigned_key_default_null | int(10) unsigned | YES | MUL | NULL | |
| col_set_utf8 | set('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') | YES | | NULL | |
| col_enum_latin1_default_null | enum('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') | YES | | NULL | |
| col_int | int(11) | YES | | NULL | |
| col_char_64_latin1_not_null | char(64) | NO | | NULL | |
| col_set_latin1_not_null | set('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') | NO | | NULL | |
| col_char_64_utf8_key_default_null | char(64) | YES | MUL | NULL | |
| col_set_latin1_key | set('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') | YES | MUL | NULL | |
| col_enum_latin1 | enum('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') | YES | | NULL | |
| col_enum_utf8_default_null | enum('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') | YES | | NULL | |
| col_set_latin1_default_null | set('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') | YES | | NULL | |
| col_char_64_utf8_default_null | char(64) | YES | | NULL | |
| col_datetime_key | datetime | YES | MUL | NULL | |
| col_set_utf8_default_null | set('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') | YES | | NULL | |
| col_set_utf8_key | set('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') | YES | MUL | NULL | |
| col_char_64_latin1 | char(64) | YES | | NULL | |
| col_char_64_utf8_not_null | char(64) | NO | | NULL | |
| col_int_not_null_key | int(11) | NO | MUL | NULL | |
| col_int_unsigned_not_null_key | int(10) unsigned | NO | MUL | NULL | |
| col_char_64_latin1_key_default_null | char(64) | YES | MUL | NULL | |
| col_int_unsigned | int(10) unsigned | YES | | NULL | |
| col_enum_utf8_key | enum('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') | YES | MUL | NULL | |
| col_enum_latin1_key_default_null | enum('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') | YES | MUL | NULL | |
| col_set_utf8_not_null_key | set('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') | NO | MUL | NULL | |
| col_char_64_utf8 | char(64) | YES | | NULL | |
| col_set_latin1_key_default_null | set('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') | YES | MUL | NULL | |
| col_datetime_not_null | datetime | NO | | NULL | |
| col_int_unsigned_not_null | int(10) unsigned | NO | | NULL | |
| col_enum_utf8_not_null_key | enum('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') | NO | MUL | NULL | |
| col_char_64_latin1_default_null | char(64) | YES | | NULL | |
| col_enum_latin1_not_null | enum('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') | NO | | NULL | |
| col_int_not_null | int(11) | NO | | NULL | |
| col_set_latin1 | set('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') | YES | | NULL | |
| col_set_utf8_not_null | set('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') | NO | | NULL | |
| col_datetime | datetime | YES | | NULL | |
| col_datetime_default_null | datetime | YES | | NULL | |
| col_int_key | int(11) | YES | MUL | NULL | |
| col_set_utf8_key_default_null | set('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') | YES | MUL | NULL | |
| col_char_64_latin1_key | char(64) | YES | MUL | NULL | |
| col_char_64_utf8_key | char(64) | YES | MUL | NULL | |
| col_enum_latin1_not_null_key | enum('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') | NO | MUL | NULL | |
| pk | int(11) | NO | PRI | NULL | auto_increment |
| col_set_latin1_not_null_key | set('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') | NO | MUL | NULL | |
| col_int_unsigned_default_null | int(10) unsigned | YES | | NULL | |
| col_enum_utf8_not_null | enum('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') | NO | | NULL | |
| col_char_64_utf8_not_null_key | char(64) | NO | MUL | NULL | |
| col_datetime_not_null_key | datetime | NO | MUL | NULL | |
| col_char_64_latin1_not_null_key | char(64) | NO | MUL | NULL | |
| col_enum_utf8 | enum('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') | YES | | NULL | |
| col_int_key_default_null | int(11) | YES | MUL | NULL | |
+-------------------------------------+---------------------------------------------------------------------------------------------------------------+------+-----+---------+----------------+
55 rows in set (0.00 sec)
The text was updated successfully, but these errors were encountered: