Stateful hash ring without ring manager

warningstateful-hash-ring-without-ring-manager

A stateful service on a consistent hash ring needs something that owns the ring: detect a dead host, pick a replacement, tell everyone. Without a coordination service the ring is edited by hand during the outage.

Severity
warning
Selects
every node of kind app-server
Components in scope
99
What it checks

It looks at every node of kind app-server, and fires when:

  • — all of these hold:
  • — the node's `shardingStrategy` is "consistent-hash"
  • — this does not hold:
  • — the node has at least one connected edge joining a coordination-service
Message
Service '{{node.id}}' is on a consistent hash ring but is not connected to a coordination service that manages the ring.

{{node.id}} style paths are filled in from the node, the edge or the design the finding is about.

Applies to · 99 components
Tripped by · 9

Reference designs whose broken twin names this rule in its header. The gate reads the same header, and fails when a rule no design trips.

Source
# yaml-language-server: $schema=../schema/rule.schema.json
# A stateful service on a consistent hash ring needs something to own the ring: detect a
# dead host, pick a replacement and tell everyone. Without a ring manager (a
# coordination service) the ring is edited by hand during the outage.
# Tests "this node has no edge to a coordination service" rather than "the design has no
# coordination service" so it can co-fire with reconnect-stampede-without-guard, which
# requires one to exist.
# Tripped by: designs/slack-messaging.broken.yaml
schemaVersion: "1"
type: "rule"
id: "stateful-hash-ring-without-ring-manager"
severity: "warning"
select:
  node:
    kind: "app-server"
when:
  all:
    - prop: "shardingStrategy"
      equals: "consistent-hash"
    - not:
        hasEdge:
          direction: "any"
          peerKind: "coordination-service"
message: "Service '{{node.id}}' is on a consistent hash ring but is not connected to a coordination service that manages the ring."

The same page as markdown, for an agent: /catalogue/rules/stateful-hash-ring-without-ring-manager.md