Skip to content

feat(produce): optimize AppendCompleter to complete futures first#529

Merged
giuseppelillo merged 1 commit intomainfrom
tchary/append-completer-optimization
Mar 6, 2026
Merged

feat(produce): optimize AppendCompleter to complete futures first#529
giuseppelillo merged 1 commit intomainfrom
tchary/append-completer-optimization

Conversation

@Mwea
Copy link
Copy Markdown
Contributor

@Mwea Mwea commented Mar 5, 2026

Summary

  • Reorder AppendCompleter.finishCommitSuccessfully() to minimize producer latency
  • Complete futures IMMEDIATELY after building responses, before cache population
  • Cache operations only benefit fetch, so they shouldn't block produce responses

Test plan

  • Added futuresAreCompletedBeforeCachePopulation() test that verifies ordering
  • All existing AppendCompleterTest tests pass

🤖 Generated with Claude Code

Reorder AppendCompleter operations to minimize producer latency:

1. Build partition responses (fast, just object creation)
2. Complete futures IMMEDIATELY (critical path)
3. Populate batch coordinate cache (not on critical path)

Previously, cache population happened before completing futures,
meaning producers waited for cache operations that only benefit
fetch operations.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reduces produce-path latency by reordering AppendCompleter.finishCommitSuccessfully() so that produce response futures are completed before non-critical cache population.

Changes:

  • Reordered finishCommitSuccessfully() to (1) build responses, (2) complete futures, then (3) populate the batch-coordinate cache.
  • Added a unit test asserting futures are completed before any BatchCoordinateCache.put() calls.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
storage/inkless/src/main/java/io/aiven/inkless/produce/AppendCompleter.java Reorders response completion ahead of cache writes to reduce producer latency.
storage/inkless/src/test/java/io/aiven/inkless/produce/AppendCompleterTest.java Adds a test to enforce the future-completion-before-cache-write ordering.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@giuseppelillo giuseppelillo merged commit cff43f4 into main Mar 6, 2026
8 checks passed
@giuseppelillo giuseppelillo deleted the tchary/append-completer-optimization branch March 6, 2026 10:56
jeqo added a commit that referenced this pull request Mar 23, 2026
…anch-consistency

Replace keyword-based inkless commit detection (matching "inkless/diskless"
in message) with --first-parent git log traversal. This only walks the main
branch lineage, so upstream commits brought in via merge are naturally
excluded. All remaining non-sync commits are inkless PRs regardless of
their commit message wording.

This fixes commits like "feat(produce): optimize AppendCompleter (#529)"
being missed because they don't mention "inkless" or "diskless".

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
jeqo added a commit that referenced this pull request Mar 23, 2026
…anch-consistency

Replace keyword-based inkless commit detection (matching "inkless/diskless"
in message) with --first-parent git log traversal. This only walks the main
branch lineage, so upstream commits brought in via merge are naturally
excluded. All remaining commits with a PR number are inkless PRs regardless
of their commit message wording.

This fixes commits like "feat(produce): optimize AppendCompleter (#529)"
being missed because they don't mention "inkless" or "diskless".

Also fixes cherry-pick-to-release.sh to apply commits oldest-first instead
of newest-first, ensuring dependencies are met.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
jeqo added a commit that referenced this pull request Mar 23, 2026
…anch-consistency

Replace keyword-based inkless commit detection (matching "inkless/diskless"
in message) with --first-parent git log traversal. This only walks the main
branch lineage, so upstream commits brought in via merge are naturally
excluded. All remaining commits with a PR number are inkless PRs regardless
of their commit message wording.

This fixes commits like "feat(produce): optimize AppendCompleter (#529)"
being missed because they don't mention "inkless" or "diskless".

Also fixes cherry-pick-to-release.sh to apply commits oldest-first instead
of newest-first, ensuring dependencies are met.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
AnatolyPopov pushed a commit that referenced this pull request Mar 23, 2026
Reorder AppendCompleter operations to minimize producer latency:

1. Build partition responses (fast, just object creation)
2. Complete futures IMMEDIATELY (critical path)
3. Populate batch coordinate cache (not on critical path)

Previously, cache population happened before completing futures,
meaning producers waited for cache operations that only benefit
fetch operations.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
(cherry picked from commit cff43f4)
jeqo pushed a commit that referenced this pull request Mar 23, 2026
Reorder AppendCompleter operations to minimize producer latency:

1. Build partition responses (fast, just object creation)
2. Complete futures IMMEDIATELY (critical path)
3. Populate batch coordinate cache (not on critical path)

Previously, cache population happened before completing futures,
meaning producers waited for cache operations that only benefit
fetch operations.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
jeqo added a commit that referenced this pull request Mar 24, 2026
…anch-consistency

Replace keyword-based inkless commit detection (matching "inkless/diskless"
in message) with --first-parent git log traversal. This only walks the main
branch lineage, so upstream commits brought in via merge are naturally
excluded. All remaining commits with a PR number are inkless PRs regardless
of their commit message wording.

This fixes commits like "feat(produce): optimize AppendCompleter (#529)"
being missed because they don't mention "inkless" or "diskless".

Also fixes cherry-pick-to-release.sh to apply commits oldest-first instead
of newest-first, ensuring dependencies are met.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

3 participants