Skip to content

relay: count ingest on the relay executor, drop bogus subscriber counts - #630

Merged
afrind merged 1 commit into
relay/walk-cached-track-statsfrom
relay/count-ingest-on-relay-executor
Aug 26, 2026
Merged

relay: count ingest on the relay executor, drop bogus subscriber counts#630
afrind merged 1 commit into
relay/walk-cached-track-statsfrom
relay/count-ingest-on-relay-executor

Conversation

@afrind

@afrind afrind commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

/state read each subscription's counters off the forwarder, which in LocalForwarder mode belongs to another executor -- so the walk skipped it and reported zeros for every track. The two subscriber counts it reported were per-forwarder besides: "subscribers on this thread's forwarder", not on the relay.

TerminationFilter, already installed on both chain branches, becomes RelayIngestFilter and counts objects as they pass, into an IngestCounters the registry entry holds:

  void record(uint64_t group, uint64_t object); // objects, groups, largest

Distinct groups go through the same RecentGroupWindow TrackStatsFilter uses, so interleaved subgroups are not counted twice. /state reads those, so total_groups_received, total_objects_received and largest are right in every mode; subscribers and forwarding_subscribers are gone, and with them the json_exporter module that built per-track series out of /state -- moqx_track_subscribers from /metrics/track is the real number. Also drops getSubscribeWriteback, dead since the chain builder took over.

MoqxRelayStateTests walks /state in all three relay modes.


This change is Reviewable

@akash-a-n akash-a-n left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@akash-a-n reviewed 10 files and all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on afrind).

/state read each subscription's counters off the forwarder, which in
LocalForwarder mode belongs to another executor -- so the walk skipped it and
reported zeros for every track. The two subscriber counts it reported were
per-forwarder besides: "subscribers on this thread's forwarder", not on the
relay.

TerminationFilter, already installed on both chain branches, becomes
RelayIngestFilter and counts objects as they pass, into an IngestCounters the
registry entry holds:

  void record(uint64_t group, uint64_t object); // objects, groups, largest

Distinct groups go through the same RecentGroupWindow TrackStatsFilter uses, so
interleaved subgroups are not counted twice. /state reads those, so
total_groups_received, total_objects_received and largest are right in every
mode; subscribers and forwarding_subscribers are gone, and with them the
json_exporter module that built per-track series out of /state --
moqx_track_subscribers from /metrics/track is the real number. Also drops
getSubscribeWriteback, dead since the chain builder took over.

MoqxRelayStateTests walks /state in all three relay modes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@afrind
afrind force-pushed the relay/count-ingest-on-relay-executor branch from bb08ccf to 0ced834 Compare August 26, 2026 16:18
@afrind
afrind merged commit c8f5d6e into main Aug 26, 2026
7 of 8 checks passed
@afrind
afrind deleted the relay/count-ingest-on-relay-executor branch August 26, 2026 17:42
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