Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BitTorrent Snapshot Downloader - Inability to Download Unmerged Segments After Merging #12031

Closed
Giulio2002 opened this issue Sep 18, 2024 · 1 comment
Assignees

Comments

@Giulio2002
Copy link
Contributor

Description

After a snapshot segment is merged with another in the Erigon BitTorrent snapshot downloader, it becomes impossible to download the unmerged segments. This behavior can cause significant issues, particularly when users are syncing while we update to a new snapshot version (e.g., R2). In such scenarios, the ongoing sync process for these users can be disrupted or ruined due to the unavailability of unmerged segments.

Impact

  • Users who attempt to sync while an update to a new snapshot (e.g., R2) is in progress may experience failed or corrupted syncs.
  • This can lead to a poor user experience, increased network load as users attempt to recover, and potential data inconsistencies.

Steps to Reproduce

  1. Start syncing using the current snapshot downloader.
  2. Initiate a merge of snapshot segments.
  3. Attempt to download unmerged segments post-merge.
  4. Observe that the unmerged segments are not available for download.

An easy way to reproduce is:

./build/bin/erigon --chain=gnosis --datadir gnosis_datadir

then stop it immediately and write in gnosis_datadir/snapshots/preverified.toml the following content

https://discord.com/channels/1133875232453693480/1226807326883971072/1285689823696261230

some of the now-merged files, that are present on https://erigon3-v1-snapshots-gnosis.erigon.network/ won't be downloaded.

Expected Behavior

  • The snapshot downloader should allow the download of unmerged segments even after a segment has been merged.
  • Users should be able to continue their sync uninterrupted, regardless of the merging process.

Actual Behavior

  • After merging, unmerged segments are no longer downloadable.
  • Users syncing during this process may encounter sync failures or corrupt data.

Proposed Solution

  • Implement a mechanism to retain and provide access to unmerged segments even after a merge has taken place.
  • Ensure that the system can handle segment merges without disrupting ongoing syncs.

Additional Context

This issue becomes critical when transitioning to a new snapshot version (e.g., R2) while users are actively syncing. Ensuring that all segments, merged and unmerged, are available for download until the sync completes is essential for a stable syncing process.

Environment

  • Erigon Version: [Specify the version]
  • Operating System: [Specify OS]
  • Other Relevant Details: [Add any other details here]

Possible Workarounds

  • [If any workarounds exist, describe them here]
  • [Otherwise, state "None"]

References

  • [Link to any related issues or discussions]
@dvovk
Copy link
Member

dvovk commented Sep 28, 2024

image

Giulio2002 pushed a commit that referenced this issue Sep 29, 2024
Moved code which set preverified files list from preverified.toml before
torrent whitelist is generated.
Fix for #12031
@dvovk dvovk self-assigned this Sep 29, 2024
@dvovk dvovk closed this as completed Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants