k3s-io / kine

Run Kubernetes on MySQL, Postgres, sqlite, dqlite, not etcd.
Apache License 2.0
1.64k stars 238 forks source link

Retries in generic driver #84

Open ktsakalozos opened 3 years ago

ktsakalozos commented 3 years ago

Thank you for kine! I have a couple of questions on the retry policy used.

  1. I am trying to understand the retry time interval set in [1]. Trying the back-off strategy used (backoff.Linear(100 + time.Millisecond)) it seems too aggressive to me [2], but I do not have any data to prove this. It seems we will retry 20 times the same operation within 171 milliseconds. The backoff.Linear() takes a Duration as parameter and we currently pass in 1 millisecond and 100 nanoseconds. Aren't the 100 nano seconds shadowed by the 1 millisecond? I suspect the intention was to have something like 100 * time.Millisecond.

  2. We retry only the execute() call [3]. What about the query() [4] and queryRow() [5] calls? Shouldn't these be retried as well?

Thanks

[1] https://github.com/k3s-io/kine/blob/master/pkg/drivers/generic/generic.go#L256 [2] https://play.golang.org/p/pBxe-DUqhy- [3] https://github.com/k3s-io/kine/blob/master/pkg/drivers/generic/generic.go#L250 [4] https://github.com/k3s-io/kine/blob/master/pkg/drivers/generic/generic.go#L240 [5] https://github.com/k3s-io/kine/blob/master/pkg/drivers/generic/generic.go#L245