Skip to content

Commit

Permalink
fix(state-sync): Enable State Sync from GCS by default (#9398)
Browse files Browse the repository at this point in the history
* fix(state-sync): Enable State Sync from GCS by default

* fix(state-sync): Enable State Sync from GCS by default

* RoutingTableView: gracefully handle missing distance vectors (#9394)

The RoutingTableView in the debug UI includes a table over the direct peers of the node:

<img width="516" alt="image" src="https://github.com/near/nearcore/assets/3241341/c8c1f0b8-1e0a-458e-a2ad-f09f20fcb57c">

Each active connection of the node has one row in the table. The last column is populated using the most recent distance vector shared by the direct peer.

In some cases there may be a direct connection for which we have not received a distance vector yet. This PR allows the debug UI to gracefully handle such cases and display "null" instead of producing an error.

* fix(state-sync): Enable State Sync from GCS by default

* fix(state-sync): Enable State Sync from GCS by default

* fix(state-sync): Enable State Sync from GCS by default

---------

Co-authored-by: Saketh Are <saketh.are@gmail.com>
  • Loading branch information
nikurt and saketh-are authored Aug 9, 2023
1 parent fa75265 commit 63170aa
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* Number of transactions included in a chunk will be lowered if there is a congestion of more than 20000 delayed receipts in a shard. [#9222](https://github.com/near/nearcore/pull/9222)
* Our more efficient and scalable V2 routing protocol is implemented. It shadows the V1 protocol for now while we verify its performance. [#9187](https://github.com/near/nearcore/pull/9187)
* The default config now enables TIER1 outbound connections by default. [#9349](https://github.com/near/nearcore/pull/9349)
* State Sync from GCS is available for experimental use. [#9398](https://github.com/near/nearcore/pull/9398)

## 1.35.0

Expand Down
28 changes: 17 additions & 11 deletions chain/client/src/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -641,17 +641,23 @@ pub fn display_sync_status(
for (shard_id, shard_status) in shard_statuses {
write!(res, "[{}: {}]", shard_id, shard_status.status.to_string(),).unwrap();
}
if matches!(state_sync_config, SyncConfig::Peers) {
// TODO #8719
tracing::warn!(
target: "stats",
"The node is syncing its State. The current implementation of this mechanism is known to be unreliable. It may never complete, or fail randomly and corrupt the DB.\n\
Suggestions:\n\
* Download a recent data snapshot and restart the node.\n\
* Disable state sync in the config. Add `\"state_sync_enabled\": false` to `config.json`.\n\
\n\
A better implementation of State Sync is work in progress.");
}
match state_sync_config {
SyncConfig::Peers => {
tracing::warn!(
target: "stats",
"The node is trying to sync its State from its peers. The current implementation of this mechanism is known to be unreliable. It may never complete, or fail randomly and corrupt the DB.\n\
Suggestions:\n\
* Try to state sync from GCS. See `\"state_sync\"` and `\"state_sync_enabled\"` options in the reference `config.json` file.
or
* Disable state sync in the config. Add `\"state_sync_enabled\": false` to `config.json`, then download a recent data snapshot and restart the node.");
}
SyncConfig::ExternalStorage(_) => {
tracing::info!(
target: "stats",
"The node is trying to sync its State from external storage. The current implementation is experimental. If it fails, consider disabling state sync and restarting from a recent snapshot:\n\
- Add `\"state_sync_enabled\": false` to `config.json`, then download a recent data snapshot and restart the node.");
}
};
res
}
SyncStatus::StateSyncDone => "State sync done".to_string(),
Expand Down

0 comments on commit 63170aa

Please sign in to comment.