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

Bug Report: exists may returns random result on a sharded table #10144

Closed
zengmin-wish opened this issue Apr 26, 2022 · 3 comments · Fixed by #10152 or #10360
Closed

Bug Report: exists may returns random result on a sharded table #10144

zengmin-wish opened this issue Apr 26, 2022 · 3 comments · Fixed by #10152 or #10360

Comments

@zengmin-wish
Copy link

Overview of the Issue

We found an issue with exists : I can't provide the exact query we use, but for the query like

select exists(select * from foo where some_field=some_value)

here foo is in a sharded keyspace, it seems if the inner query has result in one shard but have no result in another shard, then the outer query will return a random 0 or 1. Not sure if it is related, but for our particular query, the table is sharded on the field 'some_field', so if Vitess is smart enough, it doesn't need to send the query to all the shard.
We tried using gen4 planner, got the same result.

Reproduction Steps

See description.

Binary Version

v13.0.0

Operating System and Environment details

# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

Log Fragments

No response

@zengmin-wish zengmin-wish added Needs Triage This issue needs to be correctly labelled and triaged Type: Bug labels Apr 26, 2022
@frouioui
Copy link
Member

frouioui commented Apr 26, 2022

Hello @zengmin-wish, we encountered a similar issue in the past (#9900). We fixed it on main (here) and on v13.0.1 (here). I see that you are running on v13.0.0, do you mind upgrading to v13.0.1 and letting us know if that solves your issue?

@frouioui frouioui added Component: Query Serving and removed Needs Triage This issue needs to be correctly labelled and triaged labels Apr 26, 2022
@GuptaManan100
Copy link
Member

Hello @zengmin-wish, me and @systay were looking at this bug today, and we can confirm that this is an issue in all the three v13.0.0, v13.0.1 and main. The draft PR for the fix is here - #10152

@systay systay self-assigned this Apr 28, 2022
@systay
Copy link
Collaborator

systay commented Apr 29, 2022

this issue is still not fixed for V3, and it needs to be backported. opening this again until that is done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment