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

[R4R]fix: tools broken because of writting metadata when open a readyonly db #1013

Merged
merged 3 commits into from
Jul 25, 2022

Conversation

joeylichang
Copy link
Contributor

@joeylichang joeylichang commented Jul 25, 2022

Description

Change the logic of writing metadata, never do write if the DB is readonly.

Rationale

Do db inspect failed:

./bsc db inspect --datadir ./
INFO [07-23|23:53:33.854] Maximum peer count                       ETH=50 LES=0 total=50
INFO [07-23|23:53:33.854] Smartcard socket not found, disabling    err="stat /run/pcscd/pcscd.comm: no such file or directory"
INFO [07-23|23:53:33.855] Set global gas cap                       cap=50,000,000
INFO [07-23|23:53:33.855] Allocated cache and file handles         database=/server/validator/geth/chaindata cache=408.00MiB handles=32767 readonly=true
INFO [07-23|23:53:33.878] Opened ancient database                  database=/server/validator/geth/chaindata/ancient readonly=true frozen=10502
CRIT [07-23|23:53:33.878] Failed to store offSetOfAncientFreezer   err="leveldb: read-only mode"

After this patch, db inspect can work well.

Example

No

Changes

Besides the bug patch, fix the misleading log info.

@unclezoro unclezoro changed the title Readyonly db [R4R]fix: tools broken because of writting metadata when open a readyonly db Jul 25, 2022
@unclezoro unclezoro merged commit 9d59a14 into develop Jul 25, 2022
@joeylichang joeylichang deleted the readyonly_db branch July 26, 2022 01:07
This was referenced Jul 28, 2022
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.

None yet

4 participants