-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
ON CONFLICT leads to unexpected error from the vectorized engine: runtime error: index out of range [4] with length 4 #74795
Comments
Hello, I am Blathers. I am here to help you get the issue triaged. Hoot - a bug! Though bugs are the bane of my existence, rest assured the wretched thing will get the best of care here. I have CC'd a few people who may be able to assist you:
If we have not gotten back to your issue within a few business days, you can try the following:
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan. |
Thanks for the detailed report! I've managed to reduce the reproduction a bit:
The query plan for the
It looks like the stack trace points to the vectorized execution engine. I can't link to the file or line where the error occurs because the file, The relevant lines look like: // keyID of 0 is reserved to represent the end of the next chain.
keyID := ht.ProbeScratch.GroupID[toCheck]
if keyID != 0 {
// ...
buildIdx = int(keyID - 1)
// ...
// Error occurs here:
buildVal := buildKeys.Get(buildIdx)
// ... I don't yet know exactly what invariants are being broken that are causing As an aside, I noticed in your |
I was incorrect. The generated
|
Thanks for the lightning response!
If people have access to GH's new code search, the file can be seen here . Not sure if useful but here's the
No problem at all. When I noticed that the file was autogenerated, I thought it would be unlikely to be a simple code change :) |
Looks like the bug was introduced in d1cbf20. |
It seems like |
Hmm, my last comment seems incorrect. I now think the issue is that |
@dimpavloff we've identified the bug and have a fix that should be merged shortly. It'll be backported to 21.2 release branch and should be included in 21.2.5 (target release date January 31). In the meantime as a workaround you could do |
Great, thank you both for the quick resolution! |
Describe the problem
CRDB returns an internal error with the below panic stack trace:
It seems that this happens only when inserting very specific data into the table; many variations of the data inserted result in successful query execution.
It also seems that removing the ON CONFLICT DO NOTHING clause or the index result in not hitting the problem.
The bug is NOT present on 21.1.13 but exists in 21.2.0-4
To Reproduce
cockroach start-single-node --insecure --store=type=mem,size=1GB
cat bug.sql | cockroach sql --url postgresql://root@localhost:26257/defaultdb?sslmode=disable
)Expected behavior
The query succeeds
Additional data / screenshots
Note that even minor changes in the values above for the first or second column result in the query succeeding.
Environment:
cockroach sql
,psql
I am new to the CockroachDB codebase but if this is a simple bug for which you could give me some pointers, I would be interested in fixing.
The text was updated successfully, but these errors were encountered: