Skip to content

[client] Avoid retry loops during historical partition writes - #4586

Open
luoyuxia wants to merge 1 commit into
apache:mainfrom
luoyuxia:fix/historical-write-throttle-expired-metadata
Open

luoyuxia wants to merge 1 commit into
apache:mainfrom
luoyuxia:fix/historical-write-throttle-expired-metadata

Conversation

@luoyuxia

@luoyuxia luoyuxia commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Purpose

Historical writes can retry rapidly when the historical request queue is full. When an original partition expires during a write, a cached partition ID can also prevent the writer from confirming that the partition is gone, causing repeated requests for the stale target.

Brief change log

  • Apply the existing per-bucket backoff to HISTORICAL_PARTITION_THROTTLED responses.
  • Invalidate both bucket metadata and the cached partition ID before rechecking a partition reported as missing. Queued writes can then reroute to __historical__, while unsafe in-flight writes fail as before.

Tests

  • ./mvnw test -pl fluss-client -am -Dtest=SenderTest -Dsurefire.failIfNoSpecifiedTests=false (43 tests passed; reactor Checkstyle and Spotless passed).
  • ./mvnw spotless:check -pl fluss-client passed.
  • git diff --check passed.

API and Format

No API or storage format changes. The backoff uses the existing client.writer.kv-backpressure.max-throttle setting.

Documentation

No new user-facing option or feature.

Back off historical writes rejected by the request queue using the existing
per-bucket throttle. Clear stale partition ID mappings when a metadata
refresh reports a missing partition, allowing queued writes to reroute or
fail instead of repeatedly targeting an expired partition.

Co-Authored-By: Codex <noreply@openai.com>
AI-Model: gpt-6
AI-Contributed/Feature: 9/9
AI-Contributed/UT: 75/75

Copilot AI 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.

🟢 Approval recommended

The changes correctly address both retry-loop causes with focused regression coverage.

0 open findings

What changed in this PR

Adds retry backoff and stale metadata invalidation for historical partition writes.

Changes:

  • Applies per-bucket throttling to historical write rejections.
  • Clears cached partition metadata before confirming deletion.
  • Adds regression coverage for throttling and rerouting.
File Description
Sender.java Handles historical throttling and stale partition IDs.
SenderTest.java Tests backoff timing and metadata invalidation.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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