tidaldb/k8s/cluster/service-peers.yaml
jx12n 31ee612f27 feat(m12p4): sharded ingestion — scatter-gather pool + cross-shard unified reads (L4)
Scale write throughput across data-shard groups while keeping a single unified
read surface:

- scatter_gather.rs: pooled fan-out across shard groups (replaces per-request
  client construction); cross-shard query results merged on one node
- cluster/node.rs: cross-shard read routing — a read on any node gathers from
  every shard group's leader and unions results
- cluster/forward.rs: fix h2 204 forward-relay bug (relay_forwarded skips body
  for 1xx/204/304 — synthesized JSON body on a 204 triggered HTTP/2 RST_STREAM
  on the real mTLS plane)
- dto.rs: cross-shard query/result DTOs
- k8s/cluster/: enable 3-group `shards:` topology (statefulset, service-peers,
  topology-configmap)
- k8s/cluster-local-kind/: local-kind overlay to run the T5 gate without Ref-A
- tidal-stress/k8s/stress-job-t5.yaml: 2-generator sharded throughput job
- tests: cluster_cross_shard_reads.rs + multiproc support; ran real on kind
- docs/profiling/m12p4-t5-sharded-throughput.md: T5 throughput findings
2026-06-14 15:17:35 -06:00

54 lines
2.1 KiB
YAML

# Headless PEER-discovery Service (m11p5 §4).
#
# Gives every StatefulSet pod a stable per-pod DNS name
# tidaldb-N.tidaldb-peers.tidaldb-cluster.svc.cluster.local
# which is exactly what the topology ConfigMap advertises as each region's
# grpc_addr/http_addr. Peers dial these names; tonic re-resolves DNS on every
# reconnect so a pod rescheduled onto a new IP becomes reachable with no peer
# restart (the whole point of the m11p5 bind/advertise split).
#
# publishNotReadyAddresses: true is LOAD-BEARING. The m11p5 readiness predicate
# 503s a joiner/quarantined/reseeding pod (so the CLIENT Service drops it from
# load-balancing — see service-client.yaml). But peer discovery, snapshot fetch,
# and the catch-up stream must still RESOLVE a not-ready joiner's DNS, or the
# joiner can never reach a seed to converge and become ready — a deadlock. This
# Service keeps NOT-ready pods in its DNS A-records for exactly that reason.
#
# This Service is also `serviceName` for the StatefulSet (stable network ids).
apiVersion: v1
kind: Service
metadata:
name: tidaldb-peers
namespace: tidaldb-cluster
labels:
app.kubernetes.io/name: tidaldb
app.kubernetes.io/part-of: tidaldb
spec:
clusterIP: None # headless: per-pod DNS, no VIP
publishNotReadyAddresses: true # keep not-ready joiners resolvable for peers
selector:
app.kubernetes.io/name: tidaldb
app.kubernetes.io/component: cluster-node
ports:
- name: http
port: 9500
targetPort: http
# One gRPC port per hosted shard group (m11p6/m12p4 3-group topology). A
# headless Service routes by pod DNS → pod IP, so peers dial the derived
# per-group ports (9601/9602/9603) on the pod directly regardless of this
# list; the entries are declared so the named ports stay discoverable and
# match statefulset.yaml. With the legacy single group only `grpc` (9601)
# is bound.
- name: grpc
port: 9601
targetPort: grpc
- name: grpc-1
port: 9602
targetPort: grpc-1
- name: grpc-2
port: 9603
targetPort: grpc-2
- name: metrics
port: 9091
targetPort: metrics