Skip to content

[improve][ml] Optimize read entries with skipCondition - #22560

Open
dao-jun wants to merge 36 commits into
apache:masterfrom
dao-jun:dev/ml_parallel_read
Open

[improve][ml] Optimize read entries with skipCondition#22560
dao-jun wants to merge 36 commits into
apache:masterfrom
dao-jun:dev/ml_parallel_read

Conversation

@dao-jun

@dao-jun dao-jun commented Apr 23, 2024

Copy link
Copy Markdown
Member

Motivation

In #19035 we introduced skipCondition to filter-out delay delivery messages before read entries from Bookkeeper, and in #21739, we also filter-out deleted(individual acked messages) before read entries.

However, it will lead to one situation: one single segment can be spit into segments. For example:
entries to be filter-out: [3, 5, 7]
entries to read: [1, 10]
then, it will be split into: [[1,2],[4], [6], [8,10]].

In the current implementation, after read [1,2] finished, then begin to read [4], after read [4] finished, then start to read [6]...
It will lead to latency increasing, memory(allocated for entries) will also be retained for a longer period of time, and affect the throughput of the system.

Modifications

Verifying this change

  • Make sure that the change passes the CI checks.

(Please pick either of the following options)

This change is a trivial rework / code cleanup without any test coverage.

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added integration tests for end-to-end deployment with large payloads (10MB)
  • Extended integration test for recovery after broker failure

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository:

@dao-jun dao-jun added area/ML category/performance Performance issues fix or improvements labels Apr 23, 2024
@dao-jun dao-jun added this to the 3.3.0 milestone Apr 23, 2024
@dao-jun dao-jun self-assigned this Apr 23, 2024
@github-actions github-actions Bot added the doc-not-needed Your PR changes do not impact docs label Apr 23, 2024
@dao-jun dao-jun changed the title [improve][ml] Make ManagedLedger read entries parallel [improve][ml] Optimize read entries with skiCondition Apr 24, 2024
@dao-jun dao-jun changed the title [improve][ml] Optimize read entries with skiCondition [improve][ml] Optimize read entries with skipCondition Apr 25, 2024
@dao-jun
dao-jun marked this pull request as ready for review April 25, 2024 08:18
@dao-jun dao-jun closed this Apr 25, 2024
@dao-jun dao-jun reopened this Apr 25, 2024
@lhotari

lhotari commented Sep 23, 2025

Copy link
Copy Markdown
Member

@dao-jun Please rebase once again

@lhotari

lhotari commented Feb 6, 2026

Copy link
Copy Markdown
Member

@dao-jun Please rebase once again

@dao-jun

dao-jun commented Feb 7, 2026

Copy link
Copy Markdown
Member Author

@lhotari will do next few days, I'm working on kafka with bookkeeper now

dao-jun added 2 commits March 3, 2026 23:53
# Conflicts:
#	managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java
#	managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/OpReadEntry.java
#	managed-ledger/src/test/java/org/apache/bookkeeper/mledger/impl/ManagedCursorTest.java
#	managed-ledger/src/test/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerTest.java
@dao-jun

dao-jun commented Mar 4, 2026

Copy link
Copy Markdown
Member Author

@lhotari Rebased, PTAL

@dao-jun

dao-jun commented Apr 3, 2026

Copy link
Copy Markdown
Member Author

@lhotari @Denovo1998 The branch updated, PTAL

dao-jun added 2 commits April 22, 2026 01:59
# Conflicts:
#	managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java
#	managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/OpReadEntry.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ML category/performance Performance issues fix or improvements doc-not-needed Your PR changes do not impact docs ready-to-test release/4.0.14 release/4.1.4 release/4.2.5 triage/lhotari/important lhotari's triaging label for important issues or PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants