Skip to content

[FSTORE-2155] onlinefs: stale offsets in kafka_offsets are reused after a backup/restore recreates the online topics - #765

Open
bubriks wants to merge 1 commit into
logicalclocks:branch-5.0from
bubriks:FSTORE-2155_5.0
Open

bubriks wants to merge 1 commit into
logicalclocks:branch-5.0from
bubriks:FSTORE-2155_5.0

Conversation

@bubriks

@bubriks bubriks commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

https://hopsworks.atlassian.net/browse/FSTORE-2155

Summary

A new cluster restore brings back the Kafka offsets OnlineFS saved in each project's kafka_offsets table, while Kafka starts without the backed-up topics and creates them again on the first write. OnlineFS then resumes each recreated partition at its restored offset and skips the records below it. From 5.3 OnlineFS notices the recreated topic by its ID; this release needs the offsets cleared by hand.

  • Disaster Recovery, New Cluster Restore: OnlineFS offsets after the restore, with a script that stops OnlineFS, clears every project's kafka_offsets and starts OnlineFS again, to run after the restore and before data is written again. It stops at the first failure and leaves OnlineFS stopped; it prints the replica count first, and a run after a failure takes it from REPLICAS.
  • On a cluster that ArgoCD syncs, self-heal is turned off before the script and back on after it (the kubectl patch commands are given), and kept off after a failure until a run has finished, since self-heal would scale OnlineFS back up while its offsets are being cleared.

The same note goes to branch-5.0, branch-5.1 and branch-5.2; review it on the branch-5.2 PR.

Related PRs

Test plan

  • hopsworks-docs markdownlint: 0 issues.
  • The loss reproduced on bubriks-2 with OnlineFS from master: topic deleted in Kafka only, 40,000 rows into the recreated topic, 20,001 missing online, equal to the sum of the stored offsets.
  • The snippet's discovery loop and MySQL access run against bubriks-2 (mysqlds-0, mysql-users-secrets key root, which branch-5.0 to branch-5.2 of hopsworks-helm also use).
  • The ArgoCD self-heal steps are not run on a cluster: they follow the ArgoCD Application spec (spec.syncPolicy.automated.selfHeal).

The branch is one commit, with the tree of 529af41, the head the checks above ran on.

🤖 Generated with Claude Code

…er a backup/restore recreates the online topics

https://hopsworks.atlassian.net/browse/FSTORE-2155

OnlineFS resumed each partition of an online topic at the offset saved
in the project's kafka_offsets table. Kafka is not part of a backup, so
after a restore that rebuilds Kafka, or a manual delete, a topic is
recreated under the same name while the saved offsets still belong to
the earlier topic, and OnlineFS skipped every record below them.
OnlineFS now keeps its offsets in one table per RonDB,
onlinefs.kafka_offsets, with the Kafka topic ID each offset was saved
for, and reads a partition from its start when its saved offset belongs
to an earlier topic of the same name. The chart moves the per-project
tables into it before OnlineFS starts, the backend stops creating them
and lists a project's offsets, the UI shows them, a loadtest checks
them, and the docs cover the upgrade, the offsets card and restores,
with a restore note for the earlier releases.

This release keeps the offsets in each project's kafka_offsets table,
without topic IDs, so the DR page's new cluster restore gets a script,
run after the restore and before data is written again, that stops
OnlineFS, clears every project's kafka_offsets and starts OnlineFS
again. It stops at the first failure and leaves OnlineFS stopped, and
prints the replica count for a later run. On a cluster ArgoCD syncs,
self-heal is turned off while it runs, since it would scale OnlineFS
back up while the offsets are being cleared.

Reviewed-by: OpenAI Codex (via codex-plugin-cc 1.0.6) <codex@openai.com>
Signed-off-by: Ralfs Zangis <ralfs@logicalclocks.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bubriks
bubriks marked this pull request as ready for review November 11, 2026 11:30

This branch has not been deployed

No deployments
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