Revert "core/rawdb: open meta file in read only mode (#26009)"#1879
Merged
brilliant-lx merged 1 commit intobnb-chain:developfrom Sep 19, 2023
Merged
Revert "core/rawdb: open meta file in read only mode (#26009)"#1879brilliant-lx merged 1 commit intobnb-chain:developfrom
brilliant-lx merged 1 commit intobnb-chain:developfrom
Conversation
This reverts commit b9ba6f6.
fynnss
approved these changes
Sep 19, 2023
Contributor
There was a problem hiding this comment.
LGTM.
Without this pr, It'll return "*.meta file: no such file or directory" error when open historical bsc snapshot database as readonly.
# ./geth db stats --datadir server/data-seed/
INFO [09-19|04:13:45.869] Maximum peer count ETH=50 LES=0 total=50
INFO [09-19|04:13:45.871] Smartcard socket not found, disabling err="stat /run/pcscd/pcscd.comm: no such file or directory"
INFO [09-19|04:13:45.875] Set global gas cap cap=50,000,000
INFO [09-19|04:13:45.875] Initializing the KZG library backend=gokzg
INFO [09-19|04:13:46.293] Using leveldb as the backing database
INFO [09-19|04:13:46.293] Allocated cache and file handles database=/server/server/data-seed/geth/chaindata cache=408.00MiB handles=4096 readonly=true
INFO [09-19|04:13:54.841] Using LevelDB as the backing database
INFO [09-19|04:13:54.847] Found legacy ancient chain path location=/server/server/data-seed/geth/chaindata/ancient
Chain metadata
databaseVersion: 8 (0x8)
headBlockHash: 0x6eab3c4761643ae9817382596332a98bbbbd6cd7ed3c870327decef37fd7711b
headFastBlockHash: 0x6eab3c4761643ae9817382596332a98bbbbd6cd7ed3c870327decef37fd7711b
headHeaderHash: 0x6eab3c4761643ae9817382596332a98bbbbd6cd7ed3c870327decef37fd7711b
lastPivotNumber: 6920578 (0x699982)
len(snapshotSyncStatus): 0 bytes
snapshotDisabled: false
snapshotJournal: 2991918 bytes
snapshotRecoveryNumber: 31435739 (0x1dfabdb)
snapshotRoot: 0xf2034e8566930e7ed51956d27bdfeec0d151c76c09fb2681f0f644e79acf6a12
txIndexTail: 0 (0x0)
fastTxLookupLimit: 2350000 (0x23dbb0)
Fatal: Could not open database: open /server/server/data-seed/geth/chaindata/ancient/headers.meta: no such file or directory
brilliant-lx
approved these changes
Sep 19, 2023
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This reverts commit b9ba6f6e4d86d0ee86c63e8f4552e233fe0450aa.
Rationale
dir
chaindatagenerated by old version of geth(before big merge) doesn't contain *meta files which are used totail deletion.so for back-compatible, still open meta file in append mode even readonly flagged.
Example
add an example CLI or API response...
Changes
Notable changes: