Commit Graph

432 Commits

Author SHA1 Message Date
Jeff Washington (jwash) 9e85499d4c
fix hash calc # storages, # slots (#20832) 2021-10-25 19:37:50 +00:00
Jeff Washington (jwash) 43ea579f63
add cli for --accounts-hash-num-passes (#20827) 2021-10-25 09:45:46 -05:00
Lijun Wang f14365f4b4
Accountsdb plugin postgres -- bulk insertion at startup (#20763)
Use bulk insertion to Postgres at startup to reduce time taken for initial snapshot restore for postgres plugin. Avoid duplicate writes of accounts at startup. Doing account plugin notification and indexing in parallel.

Improved error handling for postgres plugin to show the real db issues for debug purpose
Added more metrics for postgres plugin.
Refactored plugin centric code out to a sub module from accounts_db and added unit tests
2021-10-24 12:43:33 -07:00
Jeff Washington (jwash) 47a58a38c2
clean_accounts calls AcctIdx: get_many (#20715)
* AcctIdx: get_many

* keep read lock

* AcctIdx: get_many optionally adds to cache

* rename
2021-10-19 15:54:06 -05:00
Michael Vines 2b76ea51b4 Reduce visibility of `Hash` struct contents 2021-10-19 09:30:47 -07:00
Jeff Washington (jwash) 46bf7d4a4a
AcctIdx: support 2^24 bins (#20739) 2021-10-18 14:05:16 -05:00
Jeff Washington (jwash) 6ec159a1ae
parallelize update_index (#20601) 2021-10-18 09:07:01 -05:00
Jeff Washington (jwash) 0d934d311e
sort shrink acct indexes (#20708) 2021-10-18 09:06:32 -05:00
Jeff Washington (jwash) 70b2e5fef2
hash calc uses all threads during startup (#20735) 2021-10-15 17:41:23 -05:00
Jeff Washington (jwash) 254ad45878
sort pubkeys for clean (#20706) 2021-10-15 14:31:06 -05:00
Jeff Washington (jwash) 6d7da6dbee
clean:clone uncleaned_roots for loop (#20714) 2021-10-15 13:18:00 -05:00
Jeff Washington (jwash) 1e064c32e2
pull append_vec_id() out of loop (#20713) 2021-10-15 10:41:23 -05:00
Jeff Washington (jwash) 00b9056004
clean metric: total_us (#20707) 2021-10-15 10:41:05 -05:00
Jeff Washington (jwash) 7eead4e25f
clean stats on acct idx lookup (#20632) 2021-10-14 08:37:42 -05:00
Jeff Washington (jwash) c43b6e0248
log metric for clean_accounts.delta_insert_us (#20634) 2021-10-14 08:37:14 -05:00
Jeff Washington (jwash) aec9d8bf2f
add clean stats (#20631) 2021-10-13 08:22:11 -05:00
Jeff Washington (jwash) a8e000a2a6
add filler accounts to bloat validator and predict failure (#20491)
* add filler accounts to bloat validator and predict failure

* assert no accounts match filler

* cleanup magic numbers

* panic if can't load from snapshot with filler accounts specified

* some renames

* renames

* into_par_iter

* clean filler accts, too
2021-10-11 12:46:27 -05:00
Jeff Washington (jwash) df39b37cb8
improve clean stats (#20469) 2021-10-06 20:04:26 -05:00
Michael Vines 7027d56064 Resolve nightly-2021-10-05 clippy complaints 2021-10-06 10:37:58 -07:00
Jeff Washington (jwash) 895b46e0c3
simplify AccountsDb::new_with_config (#20473) 2021-10-06 11:41:23 -05:00
Jeff Washington (jwash) 64cf354651
Add clean metrics (#20410) 2021-10-04 18:21:45 -05:00
Jeff Washington (jwash) 2d78f8ad2a
parallelize unref_from_storage from clean_dead_slots_from_accounts_index (#20411) 2021-10-04 18:20:10 -05:00
Jeff Washington (jwash) b6a6d6986d
lift store.slot() from loop (#20409) 2021-10-04 16:07:01 -05:00
Lijun Wang fe97cb2ddf
AccountsDb plugin framework (#20047)
Summary of Changes

Create a plugin mechanism in the accounts update path so that accounts data can be streamed out to external data stores (be it Kafka or Postgres). The plugin mechanism allows

Data stores of connection strings/credentials to be configured,
Accounts with patterns to be streamed
PostgreSQL implementation of the streaming for different destination stores to be plugged in.

The code comprises 4 major parts:

accountsdb-plugin-intf: defines the plugin interface which concrete plugin should implement.
accountsdb-plugin-manager: manages the load/unload of plugins and provide interfaces which the validator can notify of accounts update to plugins.
accountsdb-plugin-postgres: the concrete plugin implementation for PostgreSQL
The validator integrations: updated streamed right after snapshot restore and after account update from transaction processing or other real updates.
The plugin is optionally loaded on demand by new validator CLI argument -- there is no impact if the plugin is not loaded.
2021-09-30 14:26:17 -07:00
Jeff Washington (jwash) 9d91a6f1b7
shrink slots at startup uses more threads (#20251) 2021-09-27 14:14:55 -05:00
Brooks Prumo 1347b507da
Handle duplicate AppendVec IDs (#20096)
When reconstructing the AccountsDb, if the storages came from full and
incremental snapshots generated on different nodes, it's possible that
the AppendVec IDs could overlap/have duplicates, which would cause the
reconstruction to fail.

This commit handles this issue by unconditionally remapping the
AppendVec ID for every AppendVec.

Fixes #17088
2021-09-23 17:34:32 -05:00
Jeff Washington (jwash) 742155c214
call set_startup and add metrics on generate_index (#20006) 2021-09-18 22:08:58 -05:00
Jeff Washington (jwash) fc647eed19
introduce trait IndexValue for accounts index (#19859) 2021-09-14 17:51:07 -05:00
Jeff Washington (jwash) 2a795614d3
accounts index keys returns by value (#19858) 2021-09-14 09:38:59 -05:00
Jeff Washington (jwash) b57e86abf2
cache account hash info (#19426)
* cache account hash info

* ledger_path -> accounts_hash_cache_path
2021-09-13 20:39:26 -05:00
Brooks Prumo ef749a2506
Flush accounts cache before calling clean_accounts() (#19839) 2021-09-13 14:56:13 -05:00
Jeff Washington (jwash) b992c02708
in_mem_accounts_index filters by range (#19779) 2021-09-12 21:57:15 -05:00
Jeff Washington (jwash) 91c3b18e1e
InMemAccountsIndex iter returns vec<owned> (#19778) 2021-09-11 20:33:04 +00:00
Jeff Washington (jwash) 2de2c6ddd7
log accounts loaded for shrink stats (#19747) 2021-09-10 12:51:58 -05:00
Jeff Washington (jwash) 97418bede3
introduce BinnedHashData type to improve some code readability (#19722) 2021-09-08 19:25:52 -05:00
Jeff Washington (jwash) 001ed66b4d
minor constant cleanup (#19721) 2021-09-08 18:26:10 -05:00
Tyera Eulberg 38bbb77989
Return error if Transaction contains writable executable or ProgramData accounts (#19629)
* Return error if Transaction locks an executable as writable

* Return error if a ProgramData account is writable but the upgradable loader isn't present

* Remove unreachable clause

* Fixup bpf tests

* Review comments

* Add new TransactionError

* Disallow writes to any upgradeable-loader account when loader not present; remove is_upgradeable_loader_present exception for all other executables
2021-09-08 15:21:52 -06:00
Jeff Washington (jwash) 456bf15012
AccountsIndexConfig -> AccountsDbConfig (#19687) 2021-09-08 04:30:38 +00:00
Jeff Washington (jwash) 982454a455
refactor do_shrink_slot_stores (#19560) 2021-09-07 15:10:49 -05:00
Jeff Washington (jwash) b3fae0a01a
move constants in functions to global space (#19622) 2021-09-03 19:46:42 -05:00
Jeff Washington (jwash) 3936c10aa0
rename var (#19588) 2021-09-03 00:55:35 +00:00
Jeff Washington (jwash) 7eb793a55e
add debugging to test (#19563)
* add debugging to test

* update cargo
2021-09-02 02:52:16 +00:00
Jeff Washington (jwash) ed2c071fe1
remove unused is_startup (#19561) 2021-09-01 18:39:00 -05:00
Jeff Washington (jwash) a5f74d86c8
make test pass with 1 bin to remove noisy failure during testing (#19554) 2021-09-01 15:58:56 -05:00
Jeff Washington (jwash) dd9481c403
parallelize index_read in shrink (#19506) 2021-09-01 15:40:59 -05:00
Jeff Washington (jwash) 82a6bbe068
add Debug trait to range for accounts index (#19531) 2021-09-01 08:13:56 -05:00
Jeff Washington (jwash) 12dc8749cf
add Copy trait to AccountInfo for fast copies to mmapped file (#19524) 2021-09-01 08:13:08 -05:00
Jeff Washington (jwash) e1939688c2
parallel shrink (#19507) 2021-08-31 11:57:34 -05:00
Jeff Washington (jwash) 0e94b8fd4e
remove redundant cancelled_shrink (#19522) 2021-08-31 11:51:48 -05:00
Jeff Washington (jwash) 9d3afba045
Debug shrink stats (#19505)
* add some shrink metrics

* renames
2021-08-31 09:04:56 -05:00