Correct missing entry handling to avoid bad warns#8339
Correct missing entry handling to avoid bad warns#8339ryoqun merged 5 commits intosolana-labs:masterfrom
Conversation
| .filter(|store| accounts_index.is_root(store.slot_id)) | ||
| .iter() | ||
| .filter(|(slot, storage)| { | ||
| **slot <= snapshot_slot && accounts_index.is_root(**slot) && !storage.is_empty() |
There was a problem hiding this comment.
slot <= snapshot_slot logic is moved from here.
|
@sakridge Does this look better?Still needs to |
Codecov Report
@@ Coverage Diff @@
## master #8339 +/- ##
========================================
+ Coverage 80.5% 80.5% +<.1%
========================================
Files 253 253
Lines 55412 55465 +53
========================================
+ Hits 44637 44681 +44
- Misses 10775 10784 +9 |
Yea. This looks really good. Thanks for the updates. |
|
For the record, this PR doesn't change the ABI: $ diff -U20 /tmp/abi8/accounts_db__test_accounts_db_serialize__AccountsDBSerializeAbiTestWrapper_frozen_abi__test_digest_DAT7VpkAnXSw7r9pDHppJSqKCRYC8YAF4yCDAfkCbVE5 /tmp/abi8/accounts_db__test_accounts_db_serialize__AccountsDBSerializeAbiTestWrapper_frozen_abi__test_digest_2zC1Q4tpzCGw88khu3Aab13zM4cQzeH9kq2SHtMyrhvc
--- /tmp/abi8/accounts_db__test_accounts_db_serialize__AccountsDBSerializeAbiTestWrapper_frozen_abi__test_digest_DAT7VpkAnXSw7r9pDHppJSqKCRYC8YAF4yCDAfkCbVE5 2020-02-21 12:41:47.146055549 +0900
+++ /tmp/abi8/accounts_db__test_accounts_db_serialize__AccountsDBSerializeAbiTestWrapper_frozen_abi__test_digest_2zC1Q4tpzCGw88khu3Aab13zM4cQzeH9kq2SHtMyrhvc 2020-02-21 12:48:42.452915738 +0900
@@ -1,30 +1,30 @@
struct AccountsDBSerializeAbiTestWrapper (fields = 1)
field owned: solana_runtime::accounts_db::test_accounts_db_serialize::_IMPL_SERIALIZE_FOR_AccountsDBSerializeAbiTestWrapper::<impl serde::ser::Serialize for solana_runtime::accounts_db::test_accounts_db_serialize::AccountsDBSerializeAbiTestWrapper>::serialize::__SerializeWith
tuple (elements = 4)
element solana_runtime::accounts_db::AccountStorageSerialize
map (entries = 1)
- key &u64
+ key u64
primitive u64
- value alloc::vec::Vec<&alloc::sync::Arc<solana_runtime::accounts_db::AccountStorageEntry>>
+ value &alloc::vec::Vec<alloc::sync::Arc<solana_runtime::accounts_db::AccountStorageEntry>>
seq (elements = 1)
- element &&alloc::sync::Arc<solana_runtime::accounts_db::AccountStorageEntry>
+ element &alloc::sync::Arc<solana_runtime::accounts_db::AccountStorageEntry>
struct AccountStorageEntry (fields = 3)
field id: usize
primitive u64
field accounts: solana_runtime::append_vec::AppendVec
bytes [u8] (len = 8)
field count_and_status: std::sync::rwlock::RwLock<(usize, solana_runtime::accounts_db::AccountStorageStatus)>
tuple (elements = 2)
element usize
primitive u64
element solana_runtime::accounts_db::AccountStorageStatus
enum AccountStorageStatus (variants = 3)
variant(0) Available (unit)
variant(1) Full (unit)
variant(2) Candidate (unit)
element u64
primitive u64
element u64
primitive u64
element &solana_runtime::accounts_db::BankHashInfo
struct BankHashInfo (fields = 2)
Generated by this branch: https://github.com/ryoqun/solana/commits/abi-management-implementation-for-missing-storage-entry-handling |
Pull request has been modified.
* Correct missing entry handling to avoid bad warns * Pass storage entries to AccountStorageSerialize * Fix CI..... * Add tests and reorder condition for cheapest first * Remove unneeded reference (cherry picked from commit d238371) # Conflicts: # runtime/src/bank.rs
|
@mvines Btw, snapshots created after this PR doesn't anymore produce bad snapshots, which cause these scary warnings to be printed when loading from it as some validators are scared of: |
|
Awesome, thanks :) |
$ git diff --no-index /tmp/abi8/*{8HonGUuN4veVMzn6JBsUd2o7AkTRkkrKxy1bQeB5rnvE,EpX1HbzgTKh1jki8aVJKzTL3dWoA5cknxn6qr6WDrwm}*
diff --git a/tmp/abi8/accounts_db__test_accounts_db_serialize__AccountsDBSerializeAbiTestWrapper_frozen_abi__test_digest_8HonGUuN4veVMzn6JBsUd2o7AkTRkkrKxy1bQeB5rnvE b/tmp/abi8/accounts_db__test_accounts_db_serialize__AccountsDBSerializeAbiTestWrapper_frozen_abi__test_digest_EpX1HbzgTKh1jki8aVJKzTL3dWoA5cknxn6qr6WDrwm
index 2607110e2..92dbb9206 100644
--- a/tmp/abi8/accounts_db__test_accounts_db_serialize__AccountsDBSerializeAbiTestWrapper_frozen_abi__test_digest_8HonGUuN4veVMzn6JBsUd2o7AkTRkkrKxy1bQeB5rnvE
+++ b/tmp/abi8/accounts_db__test_accounts_db_serialize__AccountsDBSerializeAbiTestWrapper_frozen_abi__test_digest_EpX1HbzgTKh1jki8aVJKzTL3dWoA5cknxn6qr6WDrwm
@@ -1,3 +1,3 @@
struct AccountsDBSerializeAbiTestWrapper (fields = 1)
field owned: solana_runtime::accounts_db::test_accounts_db_serialize::_IMPL_SERIALIZE_FOR_AccountsDBSerializeAbiTestWrapper::<impl serde::ser::Serialize for solana_runtime::accounts_db::test_accounts_db_serialize::AccountsDBSerializeAbiTestWrapper>::serialize::__SerializeWith
- bytes [u8] (len = 572)
+ bytes [u8] (len = 180)
| pub fn get_snapshot_storages(&self) -> SnapshotStorages { | ||
| self.rc | ||
| .get_snapshot_storages(self.slot()) | ||
| .into_iter() |
Problem
Bogus warnings is introduced by #7281. Also this is needed for #8337 because compacting at
generate_indexcauses a lot of missing storage entries.Summary of Changes
Put empty dummy files for missing storage entry's AppendVec in the snapshot file.=> Changed the design strategy to change
AccountStorageSerializeas discussed on discord.This changes ABI for snapshots.=> this is not true anymore; this shouldn't introduce any ABI changes.