Skip to content

Conversation

@rodesai
Copy link
Contributor

@rodesai rodesai commented May 10, 2025

Support taking snapshots from ResponsiveKafkaStreams. Note that with this patch we can take snapshots of flat applications (no repartition topics) that are actively consuming data. Support for more complex topologies and idle applications is deferred to a later patch.

  • Adds SnapshotCommitListener, which listens on commits and takes
    task snapshots for any tasks represented in a commit that are not
    yet on the current generation.
  • Hooks up all the support types and commit listener to the responsive
    clients.
  • Adds some config for enabling/disabling snapshots

This builds on #460 and #461 so review those first

rodesai added 3 commits May 9, 2025 22:30
This patch adds a number of support types that are used to coordinate execution
of a snapshot. They correspond to the entities defined in
https://www.notion.so/responsivedev/Snapshot-Protocol-1a627549be4c8075a909cfd05adae3af

SnapshotStore defines an interface for a store for Snapshot metadata. Its essentially
a table of all the snapshots taken of an application keyed by generation.

TopicSnapshotStore implements SnapshotStore by writing snapshot metadata to a topic
and using a Kafka transaction to do transactional updates to the current snapshot.

SnapshotOrchestrator defines the interface between Kafka Streams tasks and the
snapshot orchestration process. Its how the tasks discover what the target generation
should be, and how they report their task snapshot metadata (offsets+checkpoints).

LocalSnapshotOrchestrator implements SnapshotOrchestrator for settings where the
orchestrator runs embedded in the application.

SnapshotApi defines the interface for interacting with snapshots from outside the
application.

LocalSnapshotApi implements SnapshotApi for settings where the api interacts directly
with the SnapshotStore (rather than going through another api service like we might
for responsive cloud) - e.g. in settings where we're just orchestrating snapshots
locally by storing metadata in a topic using TopicSnapshotStore.
Adds TopologyTaskInfo which builds a mapping between partitions
and tasks given a TopologyDescription.
- Adds SnapshotCommitListener, which listens on commits and takes
  task snapshots for any tasks represented in a commit that are not
  yet on the current generation.
- Hooks up all the support types and commit listener to the responsive
  clients.
- Adds some config for enabling/disabling snapshots
@rodesai rodesai changed the title Add snapshot commit listener Support taking snapshots from ResponsiveKafkaStreams May 10, 2025
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