Skip to content

Pick a PUT coordinator based on vnode mailbox queue length#1670

Closed
russelldb wants to merge 19 commits into
basho:develop-2.2from
russelldb:rdb/gh1661
Closed

Pick a PUT coordinator based on vnode mailbox queue length#1670
russelldb wants to merge 19 commits into
basho:develop-2.2from
russelldb:rdb/gh1661

Conversation

@russelldb

@russelldb russelldb commented May 2, 2018

Copy link
Copy Markdown
Contributor

See riak#1661 for initial discussion

This PR depends on basho/riak_core#921

Even a small vnode queue can lead to large fluctuations in higher-percentile latencies for coordinated PUT operations.

This PR uses the vnode proxy's estimate of the vnode queue length to select a PUT coordinator.

BEFORE:

  • Client sends a PUT to any riak node.
  • If that node happens to be in the preflist, then it coordinates the PUT.
  • If that node is not in the preflist, a node is chosen at random from the preflist and the operation is forwarded to that node to locally coordinate the put.
  • Coordinating the put means that the operation must complete on the coordinating vnode, before it is sent to n-1 other vnodes for replication.

AFTER:

  • Client sends a PUT to any riak node.
  • If that node happens to be in the preflist check it's mailbox queue length.
  • If that mailbox queue is under the soft-limit the node coordinates the put.
  • f queue is over the soft-limit or the proxy does not respond in time, check the remote preflist nodes's vnode queues.
  • The first to respond below the soft-limit is forwarded to.
  • If none are below the threshold, and the local vnode responded, then the local vnode is used (DISCUSS!! Suspect forwarding might make sense here, if just to provide some backoff)
  • If none reply in time, then a random one used.
  • If the local vnode did not respond, and some remote(s) did respond, but are soft-loaded, pick the shortest queue.

We tested this for 24hrs on the NHS benchmark cluster, using leveldb, and saw a significant improvement in 99th+ percentile latencies. See

russelldb added 13 commits May 2, 2018 14:35
Trying to track down the deluge of timeout messages at pb server
Rather than forward from a non-local to a local, and then maybe forward
again for soft-limit, if the put lands on a non-preflist node, check the
remote mailboxes and pick the first to answer with a non-loaded mailbox.

Fixes the bug where a non-preflist forwarding put fsm would never
receive an ack, and therefore would run prepare/put and finally send an
ignored message to riak_api_pn_server, resulting in log spam
IN the case that ALL preflist entries are "loaded" we select the least
loaded. The function returned an Entry, not a node(). This commit fixes
that. NOTE: shoulda used dialyzer!
The sort now returns a node, not an entry, fix the test to match
@russelldb russelldb changed the title WIP: DO NOT MERGE: a look at using vnode mailbox to pick a coordinator Pick a PUT coordinator based on vnode mailbox queue length Jun 19, 2018
@martincox martincox closed this Jun 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants