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

Fix for transactions not allowed to finish during PlannedReparentShard #8098

Merged
merged 2 commits into from
May 14, 2021

Conversation

systay
Copy link
Collaborator

@systay systay commented May 11, 2021

An issue was introduced In a recent fix (#8041) which was a backport of #7879

Before sending queries to a tablet, #7879 changed the behaviour to check if the tablet is ready to answer, by checking it's ServingStatus and that the tablet type hasn't changed.

If PlannedReparentShard is going on, this check should not be done for transactions in flight.
The vttablet waits for inflight transactions to get commit/rollback i.e. we want queries to existing transaction to be sent down to get the transaction completed, even if the tablet is currently saying it is NotServing.

The test that exposed this issue was already in the code base: go/test/endtoend/tabletgateway/buffer/buffer_test.go became flaky after #7879 was merged.

So, to fix the issue, the pre-check is removed from Gateway when getting the tablet connection for existing active shard_sessions with vttablet.

This also means that the reserved connection that used to reset based on this pre-check logic will have to hit the vttablet first and then only will reset the shard session on receiving the expected error making it two round trips.

Related Issue(s)

Backport of #8089

Backport of vitessio#8089
This is a combination of 3 commits.

* remove precheck of tablet serving and target
* remove the additional logic and return error if queryservice not found to serve query
* fix test as per new change

Signed-off-by: Harshit Gangal <harshit@planetscale.com>

Signed-off-by: Andres Taylor <andres@planetscale.com>
@deepthi deepthi changed the title Queryservice fix [9.0] Queryservice fix May 11, 2021
@harshit-gangal
Copy link
Member

some unit tests are failing.

@deepthi
Copy link
Member

deepthi commented May 12, 2021

As discussed offline, let us create an issue the describes the regression and link to the backport PRs.

deepthi
deepthi previously approved these changes May 13, 2021
Signed-off-by: deepthi <deepthi@planetscale.com>
@deepthi deepthi dismissed their stale review May 13, 2021 21:59

Unit tests are failing

@deepthi
Copy link
Member

deepthi commented May 13, 2021

some unit tests are failing.

We should have listened to @harshit-gangal. One of the perils of doing backports is that we may pull in changes that don't make sense on an older branch. That is what seems to have happened here. Tests should pass with the latest commit that reverts the unwanted changes.

Copy link
Member

@deepthi deepthi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed the diff carefully against the diff in #8089 to ensure that we are not pulling in anything extraneous.
LGTM

@deepthi deepthi merged commit e61a88a into vitessio:release-9.0 May 14, 2021
@deepthi deepthi deleted the 9.0-8089 branch May 14, 2021 01:08
@systay systay changed the title [9.0] Queryservice fix Fix for transactions not allowed to finish during PlannedReparentShard May 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants