Skip to content

How It Works

Jobs arrive on per-type Pulsar topics, are retried with exponential backoff up to 10 times, then move to a dead-letter topic. Schedules run only on the SunLink leader.

Job model

  • One topic per job type: persistent://odssbc/fairfeather/jobs-<type>, with types outbox-delivery, cassandra-repair, cassandra-snapshot and telemetry-purge.
  • Key_Shared subscription fairfeather-workers. Message key <service>:<tenant> for outbox jobs and <service> for maintenance jobs.
  • Every job carries a job_id (UUIDv7); outbox jobs also carry (tenant_id, outbox_id).
  • Negative acknowledgement with exponential redelivery: 1 s, 2 s, 4 s and so on, capped at 15 min. After 10 attempts, the message moves to jobs-<type>-DLQ.

Outbox flow

  1. Bubbl publishes {tenant, outbox_id} to jobs-outbox-delivery after it commits its logged batch.
  2. A sweeper on Bubbl’s leader republishes entries that are still pending after 5 minutes.
  3. The FairFeather worker reads the entry from Bubbl through the internal API, posts it to Redfly’s /v1/sync/bubbl, then marks it delivered through Bubbl.

Schedules (leader only)

JobWhenWhat happens
Incremental repairNightly 01:17 Pacific, staggeredCalls each service’s /internal/maintenance/repair
SnapshotsNightly 02:17Each service snapshots, encrypts with its <service>-snapshots key and uploads to s3://<bucket>/<service>/<date>/<pod>/; 30 daily and 12 monthly copies
Telemetry purgeNightly 03:17Calls DarkCrow /v1/admin/purge

Each target service exposes an internal, mTLS-only endpoint, /internal/maintenance/{repair|snapshot}, which calls its in-JVM Cassandra. For snapshots, the target encrypts the files with its own OpenBao Transit key before uploading, so FairFeather never handles the plaintext.

Data layer

Keyspace fairfeather, using NetworkTopologyStrategy {<dc>: 3}. The CQL is written by hand.

TablePrimary keyHolds
jobs(job_id)type, key, payload, status (queued|running|done|dead), attempts, created_at, updated_at
jobs_by_status((type, status), updated_at, job_id)Jobs by type and status
job_attempts(job_id, attempt)started_at, finished_at, error, pod; TTL 90 days
schedules(name)cron, last_run_at, last_status

Authentication and REST interfaces

Service callers authenticate with mTLS. Admin users present a Redfly PASETO, checked against the Shiro permission jobs:admin, which the operator and platform-admin roles hold.

MethodPathAuthPurpose
POST/v1/jobsservice mTLSSubmit a job (type and payload)
GET/v1/jobs/{id}jobs:admin or serviceJob status and attempts
GET/v1/jobs?type=&status=jobs:adminList jobs
POST/v1/jobs/{id}/requeuejobs:adminRequeue a dead job

Ports

PortBindPurpose
8447pod IPHTTPS job API and health
7000pod IP, TLSCassandra internode traffic
9042127.0.0.1CQL native (app → embedded Cassandra)
2181127.0.0.1SunLink ZooKeeper protocol (Curator)
7480pod IP, mTLSSunLink Raft ring between replicas
6379127.0.0.1SeaWave RESP (Spring Session, deny-list)
7481pod IP, mTLSSeaWave peer replication

Key environment variables

VariablePurpose
FAIRFEATHER_PULSAR_SERVICE_URLPulsar broker URL
FAIRFEATHER_SUNLINK_CLUSTERSunLink peers
FAIRFEATHER_CASSANDRA_DATA_DIR, _DC, _SEEDSEmbedded Cassandra for job state
FAIRFEATHER_S3_ENDPOINT / _BUCKET / _CREDENTIALS_FILESnapshot storage
FAIRFEATHER_TARGETSService endpoints for maintenance calls, e.g. bubbl=https://bubbl:8446,...
FAIRFEATHER_REDFLY_URL, _REDFLY_KEYS_URLRedfly sync URL and public keys