-
Notifications
You must be signed in to change notification settings - Fork 689
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
state sync: improvements from mocknet testing (#12507)
This PR contains several fixes which improve the speed and robustness of state sync: - **All part requests to peers are now made before all cloud attempts**. Previously we focused on obtaining specific parts one by one, which could cause a thread to block for a long time until a particular part was uploaded to cloud storage. It takes tens of minutes after the epoch ends for dumper nodes to write all state parts to cloud storage, whereas peer hosts are ready to serve all requests as soon as the epoch ends. - **Part request order is randomized at each syncing node**, preventing spikes in demand to specific hosts. - **Removes an unnecessary check for state headers when serving state parts**. In some cases this was preventing peer hosts which do not track all shards from responding successfully to part requests. Before these changes, it took up to 75 minutes for nodes to download parts for the largest shard (38.8 GiB in 1324 parts). After these changes: * Nodes consistently finish downloading parts in under 15 min, * State requests to peer hosts have a failure rate below 1%, * and 100% of parts are successfully obtained from peer hosts within three requests. <img width="1374" alt="Screenshot 2024-11-24 at 7 17 39 AM" src="/~https://github.com/user-attachments/assets/90537548-514b-49b6-87aa-e08b21a24f86"> ----- Additional minor improvements: - Adds a separate config parameter to specify how long to wait after a failed cloud download. This allows nodes to avoid spamming requests to cloud storage before parts have been uploaded. - Adds metrics recording the number of cache hits and misses when serving state part requests. - Distinguishes different types of errors collected in the `near_state_sync_download_result` metric. Closes issues #12497, #12498, #12499 Once merged this PR should be cherry-picked into the 2.4 release. cc @staffik
- Loading branch information
1 parent
a83c184
commit f7a9bca
Showing
19 changed files
with
244 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.