Skip to content

[improve] PIP-404: Introduce per ledger properties - #24076

Merged
dao-jun merged 9 commits into
apache:masterfrom
dao-jun:dev/per-ledger-properties
Apr 29, 2025
Merged

dao-jun merged 9 commits into
apache:masterfrom
dao-jun:dev/per-ledger-properties

Conversation

@dao-jun

@dao-jun dao-jun commented Mar 13, 2025

Copy link
Copy Markdown
Member

PIP: #23837

Motivation

Introduce per ledger properties

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

@dao-jun dao-jun added type/feature The PR added a new feature or issue requested a new feature type/PIP ready-to-test area/ML labels Mar 13, 2025
@dao-jun dao-jun self-assigned this Mar 13, 2025
@github-actions github-actions Bot added the doc-not-needed Your PR changes do not impact docs label Mar 13, 2025
@codecov-commenter

codecov-commenter commented Mar 13, 2025 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 53.44828% with 27 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.26%. Comparing base (bbc6224) to head (228bab3).
⚠️ Report is 1769 commits behind head on master.

Files with missing lines Patch % Lines
...che/bookkeeper/mledger/impl/ManagedLedgerImpl.java 53.44% 18 Missing and 9 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #24076      +/-   ##
============================================
+ Coverage     73.57%   74.26%   +0.69%     
+ Complexity    32624    32570      -54     
============================================
  Files          1877     1866      -11     
  Lines        139502   144843    +5341     
  Branches      15299    16545    +1246     
============================================
+ Hits         102638   107574    +4936     
+ Misses        28908    28765     -143     
- Partials       7956     8504     +548     
Flag Coverage Δ
inttests 26.67% <0.00%> (+2.09%) ⬆️
systests 23.30% <0.00%> (-1.03%) ⬇️
unittests 73.75% <53.44%> (+0.90%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...a/org/apache/bookkeeper/mledger/ManagedLedger.java 0.00% <ø> (ø)
...che/bookkeeper/mledger/impl/ManagedLedgerImpl.java 81.44% <53.44%> (+0.78%) ⬆️

... and 1080 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dao-jun
dao-jun requested a review from nodece April 25, 2025 09:56

@jiazhai jiazhai left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1. over all LGTM. This change adds an optional field, it is safe for the existing code.
A small suggestion: If we will have more than 1 property in per ledger, It would be better to have batched operations (e.g. set/get/removeLedgerProperties), looks like the PerLedgerProperties related operations
are a little heavy (operate the data in ZK, need locks...).

@dao-jun
dao-jun requested a review from lhotari April 28, 2025 12:25
@dao-jun
dao-jun requested a review from lhotari April 29, 2025 03:05
@dao-jun
dao-jun merged commit 146907e into apache:master Apr 29, 2025
@dao-jun
dao-jun deleted the dev/per-ledger-properties branch April 29, 2025 08:18
dao-jun added a commit to ascentstream/pulsar that referenced this pull request May 8, 2025
KannarFr pushed a commit to CleverCloud/pulsar that referenced this pull request Sep 22, 2025
walkinggo pushed a commit to walkinggo/pulsar that referenced this pull request Oct 8, 2025
dao-jun added a commit to ascentstream/pulsar that referenced this pull request Apr 1, 2026
dao-jun added a commit to ascentstream/pulsar that referenced this pull request Apr 1, 2026
lhotari pushed a commit that referenced this pull request Jul 25, 2026
…ack completes after a concurrent close (#26228)

branch-4.0 adaptations:
- MLDataFormats is generated by protobuf on this branch (LightProto only from
  branch-4.2), so the merge uses the immutable LedgerInfo builder API instead of
  mutating in place.
- The upstream tests are omitted: they drive the transform through the per-ledger
  property API (asyncAddLedgerProperty / asyncGetLedgerProperty) introduced by PIP-404
  (#24076), which is not present on branch-4.0. On this branch transformLedgerInfo is
  only reachable from the offload path, which transforms already-closed ledgers, so the
  concurrent-close race cannot be reproduced here; the change is kept for correctness and
  to keep the branches aligned. Coverage of the transform callback comes from the existing
  OffloadPrefixTest / OffloadLedgerDeleteTest suites.

(cherry picked from commit 1aa37ff)
(cherry picked from commit 1d9dada)
sandeep-ctds pushed a commit to datastax/pulsar that referenced this pull request Jul 31, 2026
…ack completes after a concurrent close (apache#26228)

branch-4.0 adaptations:
- MLDataFormats is generated by protobuf on this branch (LightProto only from
  branch-4.2), so the merge uses the immutable LedgerInfo builder API instead of
  mutating in place.
- The upstream tests are omitted: they drive the transform through the per-ledger
  property API (asyncAddLedgerProperty / asyncGetLedgerProperty) introduced by PIP-404
  (apache#24076), which is not present on branch-4.0. On this branch transformLedgerInfo is
  only reachable from the offload path, which transforms already-closed ledgers, so the
  concurrent-close race cannot be reproduced here; the change is kept for correctness and
  to keep the branches aligned. Coverage of the transform callback comes from the existing
  OffloadPrefixTest / OffloadLedgerDeleteTest suites.

(cherry picked from commit 1aa37ff)
(cherry picked from commit 1d9dada)
sandeep-ctds pushed a commit to datastax/pulsar that referenced this pull request Jul 31, 2026
…ack completes after a concurrent close (apache#26228)

branch-4.0 adaptations:
- MLDataFormats is generated by protobuf on this branch (LightProto only from
  branch-4.2), so the merge uses the immutable LedgerInfo builder API instead of
  mutating in place.
- The upstream tests are omitted: they drive the transform through the per-ledger
  property API (asyncAddLedgerProperty / asyncGetLedgerProperty) introduced by PIP-404
  (apache#24076), which is not present on branch-4.0. On this branch transformLedgerInfo is
  only reachable from the offload path, which transforms already-closed ledgers, so the
  concurrent-close race cannot be reproduced here; the change is kept for correctness and
  to keep the branches aligned. Coverage of the transform callback comes from the existing
  OffloadPrefixTest / OffloadLedgerDeleteTest suites.

(cherry picked from commit 1aa37ff)
(cherry picked from commit 1d9dada)
sandeep-ctds pushed a commit to datastax/pulsar that referenced this pull request Jul 31, 2026
…ack completes after a concurrent close (apache#26228)

branch-4.0 adaptations:
- MLDataFormats is generated by protobuf on this branch (LightProto only from
  branch-4.2), so the merge uses the immutable LedgerInfo builder API instead of
  mutating in place.
- The upstream tests are omitted: they drive the transform through the per-ledger
  property API (asyncAddLedgerProperty / asyncGetLedgerProperty) introduced by PIP-404
  (apache#24076), which is not present on branch-4.0. On this branch transformLedgerInfo is
  only reachable from the offload path, which transforms already-closed ledgers, so the
  concurrent-close race cannot be reproduced here; the change is kept for correctness and
  to keep the branches aligned. Coverage of the transform callback comes from the existing
  OffloadPrefixTest / OffloadLedgerDeleteTest suites.

(cherry picked from commit 1aa37ff)
(cherry picked from commit 1d9dada)
nodece pushed a commit to ascentstream/pulsar that referenced this pull request Nov 6, 2026
…ack completes after a concurrent close (apache#26228)

branch-4.0 adaptations:
- MLDataFormats is generated by protobuf on this branch (LightProto only from
  branch-4.2), so the merge uses the immutable LedgerInfo builder API instead of
  mutating in place.
- The upstream tests are omitted: they drive the transform through the per-ledger
  property API (asyncAddLedgerProperty / asyncGetLedgerProperty) introduced by PIP-404
  (apache#24076), which is not present on branch-4.0. On this branch transformLedgerInfo is
  only reachable from the offload path, which transforms already-closed ledgers, so the
  concurrent-close race cannot be reproduced here; the change is kept for correctness and
  to keep the branches aligned. Coverage of the transform callback comes from the existing
  OffloadPrefixTest / OffloadLedgerDeleteTest suites.

(cherry picked from commit 1aa37ff)
(cherry picked from commit 1d9dada)
nodece pushed a commit to ascentstream/pulsar that referenced this pull request Nov 16, 2026
…ack completes after a concurrent close (apache#26228)

branch-4.0 adaptations:
- MLDataFormats is generated by protobuf on this branch (LightProto only from
  branch-4.2), so the merge uses the immutable LedgerInfo builder API instead of
  mutating in place.
- The upstream tests are omitted: they drive the transform through the per-ledger
  property API (asyncAddLedgerProperty / asyncGetLedgerProperty) introduced by PIP-404
  (apache#24076), which is not present on branch-4.0. On this branch transformLedgerInfo is
  only reachable from the offload path, which transforms already-closed ledgers, so the
  concurrent-close race cannot be reproduced here; the change is kept for correctness and
  to keep the branches aligned. Coverage of the transform callback comes from the existing
  OffloadPrefixTest / OffloadLedgerDeleteTest suites.

(cherry picked from commit 1aa37ff)
(cherry picked from commit 1d9dada)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ML cherry-picked/branch-4.1 doc-not-needed Your PR changes do not impact docs ready-to-test type/feature The PR added a new feature or issue requested a new feature type/PIP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants