We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
If the lookup table insert results in a duplicate key exception, it is recorded as UNKNOWN, e.g.
vtgate_api_error_counts{code="UNKNOWN",db_type="primary",keyspace="sharded",operation="Execute"} 28
This confuses and should record the metrics errors in alignment with what was sent back to the client.
Vschema:
{ "sharded": true, "vindexes": { "hash": { "type": "hash" }, "xxhash": { "type": "xxhash" }, "lookup_t1": { "type": "lookup_unique", "params": { "from": "c2", "table": "lookup_t1_backing", "to": "keyspace_id", "write_only": "false" }, "owner": "t1" } }, "tables": { "t1": { "column_vindexes": [ { "column": "c1", "name": "xxhash" }, { "column": "c2", "name": "lookup_t1" } ] }, "lookup_t1_backing": { "column_vindexes": [ { "column": "c2", "name": "hash" } ] } } }
schema:
CREATE TABLE lookup_t1_backing ( `c2` bigint unsigned NOT NULL, `keyspace_id` varbinary(128) DEFAULT NULL, PRIMARY KEY (`c2`)); create table t1 (c1 bigint not null, c2 bigint not null, c3 bigint, primary key(c1));
Run:
insert into t1 (c1,c2) values (20,21); insert into t1 (c1,c2) values (20,21);
Observe the error and that it is a duplicate key error (1062), then check the vtgate metrics, e.g.:
curl -s http://localhost:15001/metrics | grep api_error
and see that the error was recorded as UNKNOWN instead of ALREADY_EXISTS
UNKNOWN
ALREADY_EXISTS
`main`
NA
No response
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Overview of the Issue
If the lookup table insert results in a duplicate key exception, it is recorded as UNKNOWN, e.g.
This confuses and should record the metrics errors in alignment with what was sent back to the client.
Reproduction Steps
Vschema:
schema:
Run:
Observe the error and that it is a duplicate key error (1062), then check the vtgate metrics, e.g.:
and see that the error was recorded as
UNKNOWN
instead ofALREADY_EXISTS
Binary Version
`main`
Operating System and Environment details
Log Fragments
No response
The text was updated successfully, but these errors were encountered: