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 (#3904)
Co-authored-by: Matteo Merli <[email protected]> ### 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.
- Loading branch information