good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
Erigon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
a
Erigon
Commits
d7bcb298
Unverified
Commit
d7bcb298
authored
Oct 19, 2020
by
Alex Sharov
Committed by
GitHub
Oct 19, 2020
Browse files
Options
Downloads
Patches
Plain Diff
do commit by don't save partial progress (#1256)
parent
3bec75cd
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
migrations/migrations.go
+5
-1
5 additions, 1 deletion
migrations/migrations.go
migrations/receipts.go
+2
-2
2 additions, 2 deletions
migrations/receipts.go
with
7 additions
and
3 deletions
migrations/migrations.go
+
5
−
1
View file @
d7bcb298
...
...
@@ -136,7 +136,11 @@ func (m *Migrator) Apply(db ethdb.Database, datadir string) error {
log
.
Info
(
"Apply migration"
,
"name"
,
v
.
Name
)
if
err
:=
v
.
Up
(
tx
,
datadir
,
func
(
putter
ethdb
.
Putter
,
key
[]
byte
,
isDone
bool
)
error
{
if
!
isDone
{
return
nil
// don't save partial progress
// do commit, but don't save partial progress
if
err
:=
tx
.
CommitAndBegin
(
context
.
Background
());
err
!=
nil
{
return
err
}
return
nil
}
commitFuncCalled
=
true
...
...
This diff is collapsed.
Click to expand it.
migrations/receipts.go
+
2
−
2
View file @
d7bcb298
...
...
@@ -60,11 +60,11 @@ var receiptsCborEncode = Migration{
return
fmt
.
Errorf
(
"clearing the receipt bucket: %w"
,
err
)
}
// Commit clearing of the bucket - freelist should now be written to the database
if
err
:=
OnLoadCommit
(
db
,
nil
,
tru
e
);
err
!=
nil
{
if
err
:=
OnLoadCommit
(
db
,
nil
,
fals
e
);
err
!=
nil
{
return
fmt
.
Errorf
(
"committing the removal of receipt table"
)
}
// Commit again
if
err
:=
OnLoadCommit
(
db
,
nil
,
tru
e
);
err
!=
nil
{
if
err
:=
OnLoadCommit
(
db
,
nil
,
fals
e
);
err
!=
nil
{
return
fmt
.
Errorf
(
"committing again to create a stable view the removal of receipt table"
)
}
// Now transaction would have been re-opened, and we should be re-using the space
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment