Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
b9ba6f6e
Unverified
Commit
b9ba6f6e
authored
Oct 19, 2022
by
rjl493456442
Committed by
GitHub
Oct 19, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core/rawdb: open meta file in read only mode (#26009)
parent
d86fe26f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
10 deletions
+2
-10
freezer_table.go
core/rawdb/freezer_table.go
+2
-10
No files found.
core/rawdb/freezer_table.go
View file @
b9ba6f6e
...
...
@@ -148,20 +148,12 @@ func newTable(path string, name string, readMeter metrics.Meter, writeMeter metr
meta
*
os
.
File
)
if
readonly
{
// Will fail if table
doesn't exis
t
// Will fail if table
index file or meta file is not existen
t
index
,
err
=
openFreezerFileForReadOnly
(
filepath
.
Join
(
path
,
idxName
))
if
err
!=
nil
{
return
nil
,
err
}
// TODO(rjl493456442) change it to read-only mode. Open the metadata file
// in rw mode. It's a temporary solution for now and should be changed
// whenever the tail deletion is actually used. The reason for this hack is
// the additional meta file for each freezer table is added in order to support
// tail deletion, but for most legacy nodes this file is missing. This check
// will suddenly break lots of database relevant commands. So the metadata file
// is always opened for mutation and nothing else will be written except
// the initialization.
meta
,
err
=
openFreezerFileForAppend
(
filepath
.
Join
(
path
,
fmt
.
Sprintf
(
"%s.meta"
,
name
)))
meta
,
err
=
openFreezerFileForReadOnly
(
filepath
.
Join
(
path
,
fmt
.
Sprintf
(
"%s.meta"
,
name
)))
if
err
!=
nil
{
return
nil
,
err
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment