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

tm revamp: deprecate obsolete code #6241

Merged
merged 5 commits into from
Jun 3, 2020

Conversation

sougou
Copy link
Contributor

@sougou sougou commented May 29, 2020

Deprecating old TER and schemaswap.

@sougou sougou requested review from deepthi and enisoc May 29, 2020 17:45
@@ -94,6 +94,7 @@ func (agent *ActionAgent) changeTypeLocked(ctx context.Context, tabletType topod
}

// let's update our internal state (stop query service and other things)
// refreshTablet will runHealthCheck.
Copy link
Member

Choose a reason for hiding this comment

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

Is this true? I don't see where it happens.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this comment is incorrect. I likely meant broadcastHealth, which is needed to inform the subscribers of the type change. The rest of runHealthCheck seems redundant because refreshState does that part of the work, which is to start/stop services as needed.

I'll change this comment, but I'm now worried that I might have missed something. Do you see something obvious?

Copy link
Member

Choose a reason for hiding this comment

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

I can see that runHealthCheck and refreshState do similar things with start/stop services, but it is not immediately obvious whether they will both come to the same conclusion in all situations. In the old sequence of actions, refreshState would leave some breadcrumbs (disallowQueryReason) that runHealthCheck took into account.
It does seem simpler and cleaner to not call runHealthCheck here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are idempotent functions that make the system eventually converge. Many places have this call because "there's no harm". The harmful part of it is that there is no precision or clear knowledge of what state we are in and what should be done.

In this particular situation, calling the function prematurely caused a health check failure, which introduced delays that previously did not exist. I'm hoping to iterate on this to bring more clarity on what should happen when and why.

In principle, the idempotence approach is a good one, but probably not in this situation. Where I think this would be useful is synchronizing the tablet state against mysql itself.

Copy link
Member

Choose a reason for hiding this comment

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

I'm convinced. LGTM after the comment is changed to broadcastHealth().

Copy link
Member

@enisoc enisoc left a comment

Choose a reason for hiding this comment

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

LGTM

Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
It was making direct updates to the tablet record.

Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
ChangeType was invoking a runHealthCheck at the end, but this is
unnecessary because the refreshTablet call already runs it. I found
it while changing tests that were using the old TER to use the
new ChangeType calls.

Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
@sougou sougou merged commit 3af7cd8 into vitessio:master Jun 3, 2020
@sougou sougou deleted the ss-tm-deprecate-old branch June 3, 2020 02:25
@deepthi deepthi added this to the v7.0 milestone Jul 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants