Skip to content

feat: add the Kafka consumer for Studio's indexing requests - #692

Open
MoonBoi9001 wants to merge 4 commits into
mainfrom
mb9/add-kafka-consumer-plumbing-for-studio-indexing-requests
Open

feat: add the Kafka consumer for Studio's indexing requests#692
MoonBoi9001 wants to merge 4 commits into
mainfrom
mb9/add-kafka-consumer-plumbing-for-studio-indexing-requests

Conversation

@MoonBoi9001

@MoonBoi9001 MoonBoi9001 commented Aug 24, 2026

Copy link
Copy Markdown
Member

This PR adds the receiving half of the Studio-to-dipper bridge: a Kafka consumer for the subgraph indexing request events Subgraph Studio publishes over Redpanda, plus a vendored copy of Studio's protobuf schema with generated Rust bindings. Studio already produces these messages when a developer asks for their subgraph to be indexed; nothing on the dipper side could read them. A follow-up PR wires the consumer into the service.

The consumer discovers the topic's partitions from broker metadata and refuses to start when the configured topic does not exist; the topic name deliberately has no default, after a Studio consumer crash-looped in staging because its configured topic did not match the producer's. Connects are bounded by a configurable timeout, because the underlying client retries an unreachable broker with no deadline and would otherwise never return. rskafka has no consumer groups, so offset tracking belongs to the caller (the follow-up persists offsets in the dipper's database).

One deliberate divergence in the vendored schema: the propose payload carries an extra field, indexed_network_caip2id, naming the network the subgraph indexes. The dipper needs it to key indexing requests, but the field still needs to land on Studio's side; the proto file flags the divergence.

Studio announces how many indexers a subgraph deployment wants over Redpanda; the dipper will
consume those messages. This vendors Studio's protobuf schema, generates Rust bindings for it,
and adds one field, the network the subgraph indexes, which the consumer needs and Studio has.
The dipper could only send Kafka events, not read the indexing requests Studio publishes. The
new consumer finds the topic's partitions from broker metadata, refuses to start if the topic
is missing, and leaves offset tracking to the caller; SASL/TLS setup is now shared.
The Kafka client library retries an unreachable broker with no deadline, so connecting while
Redpanda is down waited endlessly, dodging every retry and shutdown path around it. Connects now
time out (60s default), reject an empty broker list, and metadata can be re-read on demand.
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.

1 participant