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

Lock-lesser transitions without additional queries #1

Merged
merged 1 commit into from
Jun 13, 2019

Commits on Jun 13, 2019

  1. Lock-lesser transitions without additional queries

    #350
    
    @arthurnn opened #350 to reduce the impact of Statesman taking gap locks
    when using MySQL. The crux of the issue is that MySQL's implementation
    of REPEATABLE READ can take wide locks when an update touches no rows,
    which happens frequently on the first transition of Statesman.
    
    By first creating the new transition, we can avoid issuing an update
    that will take the large gap lock. This order of queries meant we added
    an additional query to the transition step which could impact people who
    rely on low-latency Statesman transitions.
    
    This commit is another take on the same approach that collapses two
    queries into one, by taking the update of the old and new transition's
    most_recent column and updating them together. It's slightly janky but
    if robust, would be a good alternative to avoid additional latency.
    lawrencejones committed Jun 13, 2019
    Configuration menu
    Copy the full SHA
    fa39d5d View commit details
    Browse the repository at this point in the history