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

core/rawdb: use ro lock in readonly mode #28180

Merged
merged 3 commits into from
Sep 22, 2023
Merged

Conversation

jsvisa
Copy link
Contributor

@jsvisa jsvisa commented Sep 22, 2023

No description provided.

Signed-off-by: jsvisa <delweng@gmail.com>
Signed-off-by: jsvisa <delweng@gmail.com>
@holiman
Copy link
Contributor

holiman commented Sep 22, 2023

Technically, I understand and can agree that it is "correct", in some manner, to allow several readers of the ancients.
However, seen from the other way around: what is the usecase that drives this change?

I don't think we should make our code more elaborate/complicated unless there's a compelling usecase to motivate it.

@jsvisa
Copy link
Contributor Author

jsvisa commented Sep 22, 2023

For me, we have 2 nodes used as read-only partial-archive nodes(--nodiscover), and the full db size for each node is about 2.5TB(ancients ~800GB). As the ancient data is not read often and there are not many performance requirements, now we want to store the ancient data in a shareable EFS, so we can reduce the disk usage -800GB.

core/rawdb/freezer.go Outdated Show resolved Hide resolved
Co-authored-by: Martin Holst Swende <martin@swende.se>
@fjl fjl merged commit f1b2ec0 into ethereum:master Sep 22, 2023
2 checks passed
@fjl fjl added this to the 1.13.2 milestone Sep 22, 2023
@jsvisa jsvisa deleted the freezer-ro-lock branch September 23, 2023 01:02
tyler-smith pushed a commit to blocknative/go-ethereum that referenced this pull request Oct 12, 2023
This allows using the freezer from multiple processes at once
in read-only mode.

Co-authored-by: Martin Holst Swende <martin@swende.se>
tyler-smith pushed a commit to blocknative/go-ethereum that referenced this pull request Oct 12, 2023
This allows using the freezer from multiple processes at once
in read-only mode.

Co-authored-by: Martin Holst Swende <martin@swende.se>
siosw pushed a commit to fabriqnetwork/go-ethereum that referenced this pull request Oct 16, 2023
This allows using the freezer from multiple processes at once
in read-only mode.

Co-authored-by: Martin Holst Swende <martin@swende.se>
devopsbo3 pushed a commit to HorizenOfficial/go-ethereum that referenced this pull request Nov 10, 2023
This allows using the freezer from multiple processes at once
in read-only mode.

Co-authored-by: Martin Holst Swende <martin@swende.se>
devopsbo3 added a commit to HorizenOfficial/go-ethereum that referenced this pull request Nov 10, 2023
devopsbo3 added a commit to HorizenOfficial/go-ethereum that referenced this pull request Nov 10, 2023
sduchesneau pushed a commit to streamingfast/go-ethereum that referenced this pull request Feb 26, 2024
core/rawdb: use readonly file lock in readonly mode (ethereum#28180)

 Conflicts:
  core/rawdb/freezer.go
Conflict around our change from flock to NewFileLock.
Accepted both.

 Additions:
  core/rawdb/fileutil{,_mock}.db:
Added the now-used RLock to out interface, with a mock implementation
for wasm.
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.

3 participants