Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[server] KV snapshot scheduling stops permanently after a transient snapshot-init failure

未关闭 适合新手
#4,489 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@zhang-arvin 已经在做这个了。

开始于 2026年9月28日。

  • #4492 来自 @zhang-arvin —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
88/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
java
领域
backend

调研方向

从 fluss-server/.../kv/snapshot/PeriodicSnapshotManager.java 中的 triggerSnapshot() 开始,然后将初始化失败路径与现有的异步失败处理和 scheduleNextSnapshot() 流程进行比较。确认暂时性的初始化失败不会结束 one-shot 链,并且在后端恢复后会继续尝试执行 snapshot。

由索引模型根据 Issue 内容生成。

描述

Search before asking
  • I searched in the issues and found nothing similar.
Fluss version

main (development)

Please describe the bug

I searched in the issues and found nothing similar. Closest family:

  • #2977
  • #2978, A different start-time trigger, already fixed.
Motivation

A transient backend outage during snapshot initialization permanently disables KV snapshots for the affected buckets until the TabletServer restarts. The failure is silent after a single ERROR line: no retry, no metric alarm, no recovery when the backend returns.

Reproduction
  • Fluss 1.0.0 (also present on main, file is identical), 1 coordinator + 2 tablet servers, kv.snapshot.interval: 60s, S3-compatible remote storage.
  • Stop the object store for ~6 minutes, then restore it.
  • During the outage, tablets log Connection refused with AWS SDK retries; writes keep flowing (local hot path, unaffected).
  • After the backend returns: no new snapshot for 14+ minutes (~14 missed 60s cycles). Only snap-1/snap-2 remain (retention keeps the last two).
  • Restarting one tablet produces a fresh snapshot ~50s later (snap-4), confirming the scheduler — not the backend path — was dead.
Root cause

fluss-server/.../kv/snapshot/PeriodicSnapshotManager.java, triggerSnapshot() (v1.0.0 and main identical):

try {
    snapshotRunnableOptional = target.initSnapshot();
} catch (Exception e) {
    LOG.error("Fail to init snapshot during triggering snapshot.", e);
    return;   // <-- scheduleNextSnapshot() never called
}

Scheduling is a one-shot chain (schedule(triggerSnapshot, delay) + explicit scheduleNextSnapshot()), so returning here without rescheduling breaks the chain permanently for that bucket. The async-phase failure path (whenComplete) does track retries; only the init path drops the chain.

Observed log line proving the trigger:
ERROR org.apache.fluss.server.kv.snapshot.PeriodicSnapshotManager [] - Fail to init snapshot during triggering snapshot.

followed by total silence (no further attempts, successes, or failures).

Solution

Call scheduleNextSnapshot() on the init-failure path too (ideally with backoff after consecutive failures, mirroring the existing numberOfConsecutiveFailures tracking in the async path), so a transient backend outage degrades to missed snapshots instead of a permanently dead scheduler.

Are you willing to submit a PR?
  • I'm willing to submit a PR!
主要语言
Java
星标
2.2k
派生
656
平均合并
1 天 21 小时
30 天内合并 PR
127

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

apache/fluss 的其他 Issue

查看 apache/fluss 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。