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

lease: do lease pile-up reduction in the background #9699

Closed
wants to merge 1 commit into from

Commits on Jun 12, 2018

  1. lease: do lease pile-up reduction in the background

    This moves lease pile-up reduction into a goroutine which mostly operates on a copy of
    the lease list, to avoid locking. This prevents timeouts when the lessor is locked
    for a long time (when there are a lot of leases, mostly). This should solve etcd-io#9496.
    
    We had a problem where when we had a lot of leases (100kish), and a
    leader election happened the lessor was locked for a long time causing
    timeouts when we tried to grant a lease. This changes it so that the
    lessor is locked in batches, which allows for creation of leases while
    the leader is initializing the lessor. It still won't start expiring
    leases until it's all done rewriting them, though.
    
    Before:
    ```
    BenchmarkLessorPromote1-16                        500000 4036 ns/op
    BenchmarkLessorPromote10-16                       500000 3932 ns/op
    BenchmarkLessorPromote100-16                      500000 3954 ns/op
    BenchmarkLessorPromote1000-16                     300000 3906 ns/op
    BenchmarkLessorPromote10000-16                    300000 4639 ns/op
    BenchmarkLessorPromote100000-16                      100 27216481 ns/op
    BenchmarkLessorPromote1000000-16                     100 325164684 ns/op
    ```
    
    After:
    ```
    BenchmarkLessorPromote1-16                        500000 3769 ns/op
    BenchmarkLessorPromote10-16                       500000 3835 ns/op
    BenchmarkLessorPromote100-16                      500000 3829 ns/op
    BenchmarkLessorPromote1000-16                     500000 3665 ns/op
    BenchmarkLessorPromote10000-16                    500000 3800 ns/op
    BenchmarkLessorPromote100000-16                   300000 4114 ns/op
    BenchmarkLessorPromote1000000-16                  300000 5143 ns/op
    ```
    braintreeps authored and Micah Gates committed Jun 12, 2018
    Configuration menu
    Copy the full SHA
    187ad9a View commit details
    Browse the repository at this point in the history