Interpret ?timeout=-1 as infinite ack timeout (#107675)

APIs which perform cluster state updates typically accept the
`?master_timeout=` and `?timeout=` parameters to respectively set the
pending task queue timeout and the acking timeout for the cluster state
update. Both of these parameters accept the value `-1`, but
`?master_timeout=-1` means to wait indefinitely whereas `?timeout=-1`
means the same thing as `?timeout=0`, namely that acking times out
immediately on commit.

There are some situations where it makes sense to wait for as long as
possible for nodes to ack a cluster state update. In practice this wait
is bounded by other mechanisms (e.g. the lag detector will remove the
node from the cluster after a couple of minutes of failing to apply
cluster state updates) but these are not really the concern of clients.

Therefore with this commit we change the meaning of `?timeout=-1` to
mean that the acking timeout is infinite.
This commit is contained in:
David Turner 2024-04-30 14:54:15 +01:00 committed by GitHub
parent b0f58ab388
commit fc287bde8b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 136 additions and 8 deletions

View file

@ -1223,12 +1223,13 @@ the timeout expires, the request fails and returns an error. Defaults to `30s`.
Can also be set to `-1` to indicate that the request should never timeout.
end::master-timeout[]
tag::timeout[]
`timeout`::
(Optional, <<time-units, time units>>)
Period to wait for a response. If no response is received before the timeout
expires, the request fails and returns an error. Defaults to `30s`.
end::timeout[]
Period to wait for a response from all relevant nodes in the cluster after
updating the cluster metadata. If no response is received before the timeout
expires, the cluster metadata update still applies but the response will
indicate that it was not completely acknowledged. Defaults to `30s`.
Can also be set to `-1` to indicate that the request should never timeout.
end::timeoutparms[]
tag::transform-id[]