Skip to content

Commit

Permalink
asim: add one voter lease thrashing reproduction
Browse files Browse the repository at this point in the history
Add a simulation test where the replication factor is set to 1. This
highlights lease thrashing, which causes replica and lease count
convergence to take upwards of 20 minutes with two nodes.

Informs: #108420
Release note: None
  • Loading branch information
kvoli committed May 16, 2024
1 parent 205565c commit 1fe25bc
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions pkg/kv/kvserver/asim/tests/testdata/non_rand/one_voter
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# This test reproduces lease thrashing (#108420) when the replication factor is
# set to 1.
gen_cluster nodes=2
----

gen_ranges ranges=100 repl_factor=1 placement_skew=true
----

eval duration=20m seed=42
----
OK

plot stat=replicas
----
----

100.00 ┼──────╭────────────╮
93.33 ┤ ╭╯ ╰╮ ╰────╮
86.67 ┤ │ ╰╮ ╭╰╮───────╮
80.00 ┤ │ ╰╮ ╭─╯ ╰╮ ╰─╭╮
73.33 ┤ ╭╯ ╰╮ ╭╯ ╰╮ ╭╯╰─────────╮
66.67 ┤ │ │ ╭─╯ ╰─╮ │ ╰─╮ ╭──╰─╮╭╮──╭╮╮
60.00 ┤ ╭╯ ╰╮ │ │ ╭╯ ╰─╯ ╰╯╰──╯╰────────╮╭╮╭─╮╮
53.33 ┤ │ │ ╭─╯ ╰╮ ╭╯ ╰╯ ╰╯╰╯╰╯ ╰──────────
46.67 ┤ ╭╯ ╰╮ │ ╰─╯
40.00 ┤ │ │╭╯
33.33 ┤ │ ╰╯
26.67 ┤ ╭╯
20.00 ┤ │
13.33 ┤╭╯
6.67 ┤│
0.00 ┼╯
replicas
----
----

plot stat=leases
----
----

100.00 ┼──────╮ ╭───╮
93.33 ┤ ╰╮ ╭╯ ╰────╮
86.67 ┤ │ │ │
80.00 ┤ ╰╮ ╭╯ ╰╮ ╭─────╮
73.33 ┤ │ │ │ ╭╯ ╰─╮ ╭───╮
66.67 ┤ ╰╮╭╯ ╰╮ ╭╯ ╰╮ ╭╯ ╰─╮ ╭──╮
60.00 ┤ ││ │ │ │ │ ╰╮╭╯ ╰──╮ ╭──╮
53.33 ┤ ╭╯ ╰╮╯ ╰╭╯ │╯ ╰╭╯ ╰──╮───────╭───────
46.67 ┤ │╮ ╭╰╮ ╭╯╮ ╰╮ ╭╯╮ ╭──╰───────╯───────
40.00 ┤ ││ │ │ │ │ ╭╯╰╮ ╭──╯ ╰──╯
33.33 ┤ ╭╯╰╮ ╭╯ ╰╮ ╭╯ ╰╮ ╭─╯ ╰──╯
26.67 ┤ │ │ │ ╰╮ ╭─╯ ╰───╯
20.00 ┤ ╭╯ ╰╮ ╭╯ ╰─────╯
13.33 ┤ │ │ │
6.67 ┤ ╭╯ ╰╮ ╭────╯
0.00 ┼──────╯ ╰───╯
leases
----
----

# vim:ft=sh

0 comments on commit 1fe25bc

Please sign in to comment.