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: add more logging to checkMastership #6618

Merged
merged 2 commits into from
Aug 26, 2020

Conversation

sougou
Copy link
Contributor

@sougou sougou commented Aug 25, 2020

Signed-off-by: Sugu Sougoumarane [email protected]

@sougou sougou requested review from enisoc and deepthi August 25, 2020 02:28
@@ -468,6 +469,7 @@ func (tm *TabletManager) checkMastership(ctx context.Context, si *topo.ShardInfo
})
case err == nil:
if oldTablet.Type == topodatapb.TabletType_MASTER {
log.Infof("Shard master alias matches, and existing tablet agrees. Switching to master with tablet's master term start time: %v", oldTablet.MasterTermStartTime)
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we should also log if oldTablet.Type was not MASTER? That means the shard record and tablet record disagree, which seems like an important case to call out.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm. In this case, would it be safe to make ourselves master and match the shard record's timestamp?

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've added handling for a couple of more corner cases. LMK what you think.

@deepthi deepthi merged commit 8917adf into vitessio:master Aug 26, 2020
@sougou sougou deleted the ss-tm2-more-logs branch August 26, 2020 02:13
@deepthi deepthi added this to the v7.0.2 milestone Sep 9, 2020
@deepthi deepthi removed this from the v7.0.2 milestone Sep 9, 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