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

Remove lingering mysqld sock files on vttestserver container startup #8463

Merged

Conversation

ilikeorangutans
Copy link
Contributor

Description

When restarting vttestserver after an ungraceful shutdown mysql doesn't start up due to the lingering sock files. Took the snippet from vitess/examples/compose/vttablet-up.sh and added it to vttestserver's run.sh:

# Delete socket files before running mysqlctld if exists.
# This is the primary reason for unhealthy state on restart.
# https://github.com/vitessio/vitess/pull/5115/files
echo "Removing $VTDATAROOT/$tablet_dir/{mysql.sock,mysql.sock.lock}..."
rm -rf $VTDATAROOT/$tablet_dir/{mysql.sock,mysql.sock.lock}

Related Issue(s)

Checklist

  • Tests were added or are not required
  • Documentation was added or is not required

Deployment Notes

Copy link
Contributor

@dkhenry dkhenry left a comment

Choose a reason for hiding this comment

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

LGTM

@dkhenry dkhenry requested a review from mcronce July 13, 2021 21:17
Copy link

@mcronce mcronce left a comment

Choose a reason for hiding this comment

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

I think this looks good, the only thing I'd change would be to not rm with -r, since the things we expect to delete aren't directories

@ilikeorangutans
Copy link
Contributor Author

I think this looks good, the only thing I'd change would be to not rm with -r, since the things we expect to delete aren't directories

Good call. I'll update.

I'm surprised by all the failing tests. Could there be tests that rely on the sock file to remain?

@ilikeorangutans ilikeorangutans force-pushed the remove_lock_files_on_vttestserver_startup branch from f298fe9 to 39745e6 Compare July 14, 2021 13:48
Copy link
Member

@GuptaManan100 GuptaManan100 left a comment

Choose a reason for hiding this comment

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

LGTM

@systay systay merged commit f5e1958 into vitessio:main Jul 28, 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.

7 participants