Skip to content

Commit

Permalink
Refactor data structure representing account candidates for cleaning (#…
Browse files Browse the repository at this point in the history
…2296)

* Refactor data structure representing account candidates for cleaning

AccountsDB::clean_accounts makes unnecessary copies of large number of
pubkeys and accompanying information to find and operate on the
accounts that can be deleted from the accounts index. With this change
the candidates for deletion are organized in a single data structure
with necessary information being updated in-place, thus reducing
memory requirements of the cleaning procedure.

* Remove redundant method of CleaningInfo and make its fields private

* Rework pubkey_to_slot_set construction

* Use slice instead of Vec in parameter types

* Remove redundant duplicate expression

* Fix tests build

* Replace Vec by Box

* Fix clippy error

* Add missing expect() message

* Update expect message

* Remove unnecessary check for empty bins

* Remove redundant type specification

* Formatting fixes

* Exclude accounts with empty slot list

* Fix name in an info message

* Call scan once per pubkey

* Fix deadlock in test

* Remove redundant variable

* Find affected pubkey in all bins

* Undo BINS_FOR_TESTING change

* Avoid acquiring read lock twice in same thread

* comments

* comments

* replace if-then-else by then_some

* Don't retain entries with empty slot list

* add filtering on store counts loop

* fix fmting on scan_accounts

* extract out count_pubkeys

* extract out `insert_pubkey`

* fix fmt on `retain`

* Remove hashset_to_vec timer

* comments

---------

Co-authored-by: jeff washington <[email protected]>
  • Loading branch information
dmakarov and jeffwashington authored Aug 8, 2024
1 parent 196845e commit e8dfc9a
Showing 1 changed file with 374 additions and 269 deletions.
Loading

0 comments on commit e8dfc9a

Please sign in to comment.