sijie opened a new issue #2001: [DbLedgerStorage] Failed to cleanup db indexes 
due to NoEntryException
URL: https://github.com/apache/bookkeeper/issues/2001
 
 
   **BUG REPORT**
   
   ***Describe the bug***
   
   ```
   00:39:38.506 [db-storage-cleanup-10-1] WARN  
org.apache.bookkeeper.bookie.storage.ldb.DbLedgerStorage - Failed to cleanup db 
indexes
   org.apache.bookkeeper.bookie.Bookie$NoEntryException: Entry -1 not found in 
472560206455324944
           at 
org.apache.bookkeeper.bookie.storage.ldb.EntryLocationIndex.getLastEntryInLedgerInternal(EntryLocationIndex.java:123)
 ~[org.apache.         bookkeeper-bookkeeper-server-4.9.0.jar:4.9.0]
           at 
org.apache.bookkeeper.bookie.storage.ldb.EntryLocationIndex.removeOffsetFromDeletedLedgers(EntryLocationIndex.java:219)
 ~[org.apache.       bookkeeper-bookkeeper-server-4.9.0.jar:4.9.0]
           at 
org.apache.bookkeeper.bookie.storage.ldb.SingleDirectoryDbLedgerStorage.lambda$checkpoint$7(SingleDirectoryDbLedgerStorage.java:624)
 ~[org. apache.bookkeeper-bookkeeper-server-4.9.0.jar:4.9.0]
           at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
[?:1.8.0_181]
           at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
[?:1.8.0_181]
           at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
 [?:1.8.0_181]
           at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
 [?:1.8.0_181]
           at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 
[?:1.8.0_181]
           at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 
[?:1.8.0_181]
           at 
io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
 [io.netty-netty-all-4.1.32.Final.jar:4.1.32.Final]            at 
java.lang.Thread.run(Thread.java:748) [?:1.8.0_181]
   ```
   
   db cleanup process will be aborted when failed to no entries found in entry 
index location.
   
   ***Expected behavior***
   
   db clean up should proceed even there are no entries.
   
   ***Additional context***
   
   ```
                       entryLocationIndex.removeOffsetFromDeletedLedgers();
                       ledgerIndex.removeDeletedLedgers();
   ```
   
   removing entry locations and ledger index entry is not an atomic operation. 
if the bookie crashes between removed offsets and removing index entry, then 
when the bookie comes back online it will fail to delete entries since there 
are no entries to delete.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to