yugabyte / yugabyte-db

YugabyteDB - the cloud native distributed SQL database for mission-critical applications.
https://www.yugabyte.com
Other
8.95k stars 1.07k forks source link

[YSQL][LST] Query error: Expected first value type to be primitive or GroupEnd, got kLowest in 0000000000000000000000000000000000000000000000000000000000000000000000 #11992

Open def- opened 2 years ago

def- commented 2 years ago

Jira Link: DB-886

Description

This failure happened using the Long-running System Test framework I'm currently working on.

It can be reproduced against current master YB (ea58ecba35dacc1706293d72ec99b07b1ecb08f6) locally easily:

$ cd ~/code/yugabyte-db
$ bin/yb-ctl --replication_factor 3 create
$ cd ~/code/yb-long-system-test
$ git checkout afaa47c1 && ./long_system_test.py --threads=10 --seed=385681
[...]
2022-04-06 15:04:40,063 MainThread INFO     Creating tables for database db_lst_385681
2022-04-06 15:05:07,988 MainThread INFO     Starting worker_0: RandomSelectAction, SetConfigAction
2022-04-06 15:05:07,989 MainThread INFO     Starting worker_1: RandomSelectAction, SetConfigAction
2022-04-06 15:05:07,994 MainThread INFO     Starting worker_2: SingleInsertAction, SingleDeleteAction
2022-04-06 15:05:07,995 MainThread INFO     Starting worker_3: RandomSelectAction, SetConfigAction
2022-04-06 15:05:07,995 MainThread INFO     Starting worker_4: RandomSelectAction, SetConfigAction
2022-04-06 15:05:07,996 MainThread INFO     Starting worker_5: RandomSelectAction, SetConfigAction
2022-04-06 15:05:07,996 MainThread INFO     Starting worker_6: RandomSelectAction, SetConfigAction
2022-04-06 15:05:07,997 MainThread INFO     Starting worker_7: RandomSelectAction, SetConfigAction
2022-04-06 15:05:07,997 MainThread INFO     Starting worker_8: RandomSelectAction, SetConfigAction
2022-04-06 15:05:07,997 MainThread INFO     Starting worker_9: RandomSelectAction, SetConfigAction
2022-04-06 15:05:09,234 worker_4   ERROR    Unexpected query failure: InternalError_Query: SELECT c1_text FROM t2 OFFSET 2;
Action: RandomSelectAction
Error class: InternalError_
Error code: XX000
Error message: ERROR:  Query error: Expected first value type to be primitive or GroupEnd, got kLowest in 0000000000000000000000000000000000000000000000000000000000000000000000

Potential duplicate of https://github.com/yugabyte/yugabyte-db/issues/4534, but easily reproducible. Full LST logs: lst_2022-04-06_15:04:40_385681.zip

In the tserver warning logs I see this, not sure if related:

W0406 15:04:59.420439 1916661760 leader_election.cc:283] T c271f0baa7d04704a0fc052f92914482 P 45e4d270dde14a6f8e2f09ab5e3b65c4 [CANDIDATE]: Term 1 pre-election: Tablet error from VoteRequest() call to peer 041fd98
ba24e4d9db2e3fc983db24c28: Illegal state (yb/tserver/service_util.cc:252): Tablet not RUNNING: NOT_STARTED (tablet server error 12) (raft group state error 5)
W0406 15:05:03.824729 1923543040 replica_state.cc:771] T 9576d120b2464e76852a447439a5c09a P 45e4d270dde14a6f8e2f09ab5e3b65c4 [term 1 LEADER]: Can't advance the committed index across term boundaries until operatio
ns from the current term are replicated. Last committed operation was: 0.0, New majority replicated is: 0.0, Current term is: 1

There are many similar issues, I'm not sure if I should create issues for all of them, they all look related to this, which I am going to ignore for now:

ErrorMatcher('XX000', 'ERROR:  Query error: Expected first value type to be primitive or GroupEnd, got kLowest in'),
ErrorMatcher('XX000', 'ERROR:  Query error: Error when decoding range components of a document key: while consuming primitive values from'),
ErrorMatcher('XX000', 'ERROR:  Query error: Error when decoding range components of a document key: Expected a primitive value type, got kLowest'),
ErrorMatcher('XX000', 'ERROR:  Query error: Error when decoding range components of a document key: Unexpected end of key when decoding document key'),
ErrorMatcher('XX000', 'ERROR:  Query error: Error when decoding hashed components of a document key: Expected a primitive value type, got kLowest'),
ErrorMatcher('XX000', 'ERROR:  Query error: Error when decoding hashed components of a document key: while consuming primitive values from'),
ErrorMatcher('XX000', 'ERROR:  Query error: Expected first value type to be primitive or GroupEnd, got '),
ErrorMatcher('XX000', 'ERROR:  Query error: While decoding SubDocKey'),

Is there an easier way for me to not get these errors all the time? I'm just inserting, deleting, selecting and setting configs, so nothing special so far. I'd prefer not to ignore hundreds of errors per minute.

def- commented 2 years ago

Another occurence, seems like a duplicate of this:

2022-05-04 19:25:07,771 worker_0   ERROR    Unexpected query failure: InternalError_
Query: CREATE INDEX idx_t0_c0_float4 ON t0 USING btree (c0_float4 DESC NULLS LAST);
  values: None
  runtime: 2022-05-04 19:25:07.558 - 2022-05-04 19:25:07.771
  supports explain: False
  supports rollback: False
Action: CreateIndexAction
Error class: InternalError_
Error code: XX000
Error message: ERROR:  Internal error: Row PGSQL_WRITE client: YQL_CLIENT_PGSQL stmt_id: 5160899168 stmt_type: PGSQL_UPSERT table_id: "0000411500003000800000000000418c" schema_version: 0 range_column_values { value { float_value: -83.9921646 } } range_column_values { value { binary_value: "G\022<S\030\266\257/\362;A\327\205\325v\\\270\276\330\242\000\000!!" } } column_refs { } ysql_catalog_version: 608 partition_key: "" not in partition range: [<start>, Corruption (yb/docdb/primitive_value.cc:1044): Error when decoding range components of a document key: while consuming primitive values from 2AAA: Cannot decode value type <unknown KeyEntryType : 42> from the key encoding format: "*\xaa": 2AAA), partition key: 4DC2A7FBFD5347123C5318B6AF2FF23B41D785D5765CB8BED8A2000100012121000021, tablet: 12e51065be554fc085183b11d22ed309
tanujnay112 commented 1 year ago

I don't see this on the current master, the issue may have been addressed.