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

trim trailing / from ancient path #1400

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

simonecid
Copy link

Description

Fix a bug that leads to node corruption when --datadir.ancient has a trailing /.

To reproduce:

/usr/bin/bor snapshot prune-block --datadir=/var/lib/polygon/bor/ --datadir.ancient=/var/lib/polygon/bor/bor/chaindata/ancient/

Behaviour:

  • bor saves ancient_back to /var/lib/polygon/bor/bor/chaindata/ancient/ancient_back because of filepath.Split at line 485
  • folder ancient is deleted after pruning, removing ancient_back
  • -> node is corrupted

Fix: use TrimSuffix to remove the trailing / is present.

Changes

  • Bugfix (non-breaking change that solves an issue)
  • Hotfix (change that solves an urgent issue, and requires immediate attention)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality)
  • Changes only for a subset of nodes

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

Successfully merging this pull request may close these issues.

1 participant