Skip to content

Fix DB.Close performance regression in large databases #434#2064

Draft
ljluestc wants to merge 1 commit intocodenotary:masterfrom
ljluestc:fix/db-close-performance-issue-434
Draft

Fix DB.Close performance regression in large databases #434#2064
ljluestc wants to merge 1 commit intocodenotary:masterfrom
ljluestc:fix/db-close-performance-issue-434

Conversation

@ljluestc
Copy link

What changed?
Optimized cache.(*Cache).Close by removing duplicate callback calls in enumerateNodesWithCB and batching finalizer calls, addressing the performance regression in DB.Close for large databases (2.5TB).

Why?
Fixes Issue #434, where DB.Close took several minutes after upgrading to commit 126854af5e6d. The issue was caused by inefficient cache node enumeration, exacerbated by large cache sizes.

How did you test it?

  • Added TestDB_CloseLargeDB to simulate a large database and verify DB.Close performance.
  • Added BenchmarkDB_Close to measure close time.
  • Ran go test -race ./... to ensure no regressions or data races.

…zer calls, addressing the performance regression in for large databases (2.5TB).
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.

1 participant