Skip to content

Fix serious Performance problem of getLastEntryInLedgerInternal - #3769

Closed
gaozhangmin wants to merge 1 commit into
apache:masterfrom
gaozhangmin:getlastentryinledger
Closed

Fix serious Performance problem of getLastEntryInLedgerInternal#3769
gaozhangmin wants to merge 1 commit into
apache:masterfrom
gaozhangmin:getlastentryinledger

Conversation

@gaozhangmin

Copy link
Copy Markdown
Contributor

Motivation

Fixes #3239
Search the last entry in storage would be time consume if ledger is empty and RocksDB database is huge.

Changes

Check if the ledger is empty first.

@codecov-commenter

codecov-commenter commented Feb 8, 2023

Copy link
Copy Markdown

Codecov Report

Merging #3769 (0f135ad) into master (02e64a4) will decrease coverage by 35.54%.
The diff coverage is 0.00%.

@@              Coverage Diff              @@
##             master    #3769       +/-   ##
=============================================
- Coverage     68.02%   32.49%   -35.54%     
+ Complexity     6659     3058     -3601     
=============================================
  Files           468      468               
  Lines         40844    40848        +4     
  Branches       5235     5236        +1     
=============================================
- Hits          27786    13275    -14511     
- Misses        10807    25898    +15091     
+ Partials       2251     1675      -576     
Flag Coverage Δ
bookie ?
client ?
remaining 29.51% <0.00%> (+0.05%) ⬆️
replication ?
tls 21.06% <0.00%> (-0.13%) ⬇️

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

Impacted Files Coverage Δ
...kkeeper/bookie/storage/ldb/EntryLocationIndex.java 0.00% <0.00%> (-78.13%) ⬇️
...java/org/apache/bookkeeper/proto/BookieClient.java 0.00% <0.00%> (-100.00%) ⬇️
...a/org/apache/bookkeeper/client/api/BookKeeper.java 0.00% <0.00%> (-100.00%) ⬇️
...a/org/apache/bookkeeper/client/api/ReadHandle.java 0.00% <0.00%> (-100.00%) ⬇️
...org/apache/bookkeeper/bookie/ReadOnlyFileInfo.java 0.00% <0.00%> (-100.00%) ⬇️
...org/apache/bookkeeper/bookie/datainteg/Events.java 0.00% <0.00%> (-100.00%) ⬇️
...rg/apache/bookkeeper/client/api/CreateBuilder.java 0.00% <0.00%> (-100.00%) ⬇️
...rg/apache/bookkeeper/metastore/MetastoreTable.java 0.00% <0.00%> (-100.00%) ⬇️
.../apache/bookkeeper/bookie/storage/EntryLogger.java 0.00% <0.00%> (-100.00%) ⬇️
...apache/bookkeeper/client/impl/OpenBuilderBase.java 0.00% <0.00%> (-100.00%) ⬇️
... and 335 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@gaozhangmin gaozhangmin closed this Feb 8, 2023
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