Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Skip sync the RocksDB when no changes (apache#3904)
Co-authored-by: Matteo Merli <mmerli@apache.org> ### Motivation For the `LedgerMetadataIndex#removeDeletedLedgers` and `LedgerMetadataIndex#flush`, it will call ledgersDB sync whether the ledgersDB has changed or not. We can skip the sync call when nothing changed in the ledgersDB. ### Changes - Check whether pendingLedgersUpdates is empty in `flush()` and `pendingDeletedLedgers` is empty in removeDeletedLedgers - Move the `key.recycle()` in finally to cover keys leak when the ledgersDB operations throw an exception. (cherry picked from commit 24464ba)
- Loading branch information