Skip to content

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

Merged
unclezoro merged 3 commits intodevelopfrom
readyonly_db
Jul 25, 2022
Merged

[R4R]fix: tools broken because of writting metadata when open a readyonly db#1013
unclezoro merged 3 commits intodevelopfrom
readyonly_db

Conversation

@joey0612
Copy link
Copy Markdown
Contributor

@joey0612 joey0612 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
@joey0612 joey0612 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.

4 participants