Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[improve][broker] Don't rollover empty ledgers based on inactivity #21893

Conversation

lhotari
Copy link
Member

@lhotari lhotari commented Jan 12, 2024

Motivation

When managedLedgerInactiveLedgerRolloverTimeSeconds is set, let's say to 300 (5 minutes), the ledger will get rolled also in the case when no new entries (messages) were added to the ledger. This doesn't make sense.
Empty ledgers are deleted, but having this extra churn is causing extra load on brokers, bookies and metadata store (zookeeper).

Modifications

Skip rolling the ledger if it is empty.

Documentation

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

@lhotari
Copy link
Member Author

lhotari commented Jan 12, 2024

@lifepuzzlefun Please review this since you worked on related change #20276 in this area. #21508 is also related.

Copy link
Member

@coderzc coderzc left a comment

Choose a reason for hiding this comment

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

It is best to describe this case in the configuration document.

@lhotari
Copy link
Member Author

lhotari commented Jan 12, 2024

It is best to describe this case in the configuration document.

@coderzc The empty ledgers that get created will get deleted before this change. The user doesn't see them currently and nothing changes from the user's perspective. Documentation might not be needed in the configuration docs.
The time & size based rollover rules don't rollover the ledger if it is empty either.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c834feb) 73.72% compared to head (3f19305) 73.57%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #21893      +/-   ##
============================================
- Coverage     73.72%   73.57%   -0.16%     
+ Complexity    32405    32333      -72     
============================================
  Files          1859     1859              
  Lines        138273   138273              
  Branches      15158    15158              
============================================
- Hits         101939   101731     -208     
- Misses        28488    28657     +169     
- Partials       7846     7885      +39     
Flag Coverage Δ
inttests 24.12% <0.00%> (-0.16%) ⬇️
systests 23.62% <0.00%> (-0.28%) ⬇️
unittests 72.86% <100.00%> (-0.14%) ⬇️

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

Files Coverage Δ
...che/bookkeeper/mledger/impl/ManagedLedgerImpl.java 80.52% <100.00%> (-0.43%) ⬇️

... and 72 files with indirect coverage changes

Copy link
Contributor

@gaoran10 gaoran10 left a comment

Choose a reason for hiding this comment

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

LGTM

@poorbarcode poorbarcode merged commit 49edc3d into apache:master Jan 15, 2024
48 checks passed
@mattisonchao
Copy link
Member

well, maybe we can consider merging this logic into rollCurrentLedgerIfFull method and change the method name. :)

@Technoboy-
Copy link
Contributor

well, maybe we can consider merging this logic into rollCurrentLedgerIfFull method and change the method name. :)

we can raise another new patch for this, I think.

Technoboy- pushed a commit that referenced this pull request Jan 15, 2024
…21893)

### Motivation

When `managedLedgerInactiveLedgerRolloverTimeSeconds` is set, let's say to `300` (5 minutes), the ledger will also get rolled in the case when no new entries (messages) were added to the ledger. This doesn't make sense.
Empty ledgers are deleted, but having this extra churn is causing extra load on brokers, bookies, and metadata stores (zookeeper).

### Modifications

Skip rolling the ledger if it is empty.
lhotari added a commit that referenced this pull request Jan 15, 2024
…21893)

### Motivation

When `managedLedgerInactiveLedgerRolloverTimeSeconds` is set, let's say to `300` (5 minutes), the ledger will also get rolled in the case when no new entries (messages) were added to the ledger. This doesn't make sense.
Empty ledgers are deleted, but having this extra churn is causing extra load on brokers, bookies, and metadata stores (zookeeper).

### Modifications

Skip rolling the ledger if it is empty.

(cherry picked from commit 49edc3d)
lhotari added a commit that referenced this pull request Jan 15, 2024
…21893)

### Motivation

When `managedLedgerInactiveLedgerRolloverTimeSeconds` is set, let's say to `300` (5 minutes), the ledger will also get rolled in the case when no new entries (messages) were added to the ledger. This doesn't make sense.
Empty ledgers are deleted, but having this extra churn is causing extra load on brokers, bookies, and metadata stores (zookeeper).

### Modifications

Skip rolling the ledger if it is empty.

(cherry picked from commit 49edc3d)
mukesh-ctds pushed a commit to datastax/pulsar that referenced this pull request Mar 1, 2024
…pache#21893)

### Motivation

When `managedLedgerInactiveLedgerRolloverTimeSeconds` is set, let's say to `300` (5 minutes), the ledger will also get rolled in the case when no new entries (messages) were added to the ledger. This doesn't make sense.
Empty ledgers are deleted, but having this extra churn is causing extra load on brokers, bookies, and metadata stores (zookeeper).

### Modifications

Skip rolling the ledger if it is empty.

(cherry picked from commit 49edc3d)
(cherry picked from commit 84a4885)
mukesh-ctds pushed a commit to datastax/pulsar that referenced this pull request Mar 6, 2024
…pache#21893)

### Motivation

When `managedLedgerInactiveLedgerRolloverTimeSeconds` is set, let's say to `300` (5 minutes), the ledger will also get rolled in the case when no new entries (messages) were added to the ledger. This doesn't make sense.
Empty ledgers are deleted, but having this extra churn is causing extra load on brokers, bookies, and metadata stores (zookeeper).

### Modifications

Skip rolling the ledger if it is empty.

(cherry picked from commit 49edc3d)
(cherry picked from commit 84a4885)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants