mdbx bug in DeleteCurrentDuplicates() workaround (#7850)

This commit is contained in:
Alex Sharov 2023-07-06 11:08:23 +07:00 committed by GitHub
parent 63776ceea6
commit 0b97728862
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 7 additions and 8 deletions

View File

@ -167,7 +167,7 @@ lintci:
## lintci-deps: (re)installs golangci-lint to build/bin/golangci-lint
lintci-deps:
rm -f ./build/bin/golangci-lint
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ./build/bin v1.53.2
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ./build/bin v1.53.3
## clean: cleans the go cache, build dir, libmdbx db dir
clean:

View File

@ -1371,7 +1371,7 @@ func PruneTableDupSort(tx kv.RwTx, table string, logPrefix string, pruneTo uint6
return common2.ErrStopped
default:
}
if err = c.DeleteCurrentDuplicates(); err != nil {
if err = tx.Delete(table, k); err != nil {
return fmt.Errorf("failed to remove for block %d: %w", blockNum, err)
}
}

View File

@ -191,7 +191,7 @@ func promoteCallTraces(logPrefix string, tx kv.RwTx, startBlock, endBlock uint64
logger.Info(fmt.Sprintf("[%s] Pruning call trace table", logPrefix), "number", blockNum,
"alloc", libcommon.ByteCount(m.Alloc), "sys", libcommon.ByteCount(m.Sys))
}
if err = traceCursor.DeleteCurrentDuplicates(); err != nil {
if err = tx.Delete(kv.CallTraceSet, k); err != nil {
return fmt.Errorf("remove trace call set for block %d: %w", blockNum, err)
}
if blockNum < prunedMin {

View File

@ -794,8 +794,7 @@ func unwindExecutionStage(u *UnwindState, s *StageState, tx kv.RwTx, ctx context
if err != nil {
return err
}
err = c.DeleteCurrentDuplicates()
if err != nil {
if err = tx.Delete(kv.CallTraceSet, k); err != nil {
return err
}
}

2
go.mod
View File

@ -3,7 +3,7 @@ module github.com/ledgerwatch/erigon
go 1.19
require (
github.com/ledgerwatch/erigon-lib v0.0.0-20230627104814-797724496a65
github.com/ledgerwatch/erigon-lib v0.0.0-20230706040551-efbc6c260daa
github.com/ledgerwatch/erigon-snapshot v1.2.1-0.20230622075030-1d69651854c2
github.com/ledgerwatch/log/v3 v3.8.0
github.com/ledgerwatch/secp256k1 v1.0.0

4
go.sum
View File

@ -415,8 +415,8 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kylelemons/godebug v0.0.0-20170224010052-a616ab194758 h1:0D5M2HQSGD3PYPwICLl+/9oulQauOuETfgFvhBDffs0=
github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c=
github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8=
github.com/ledgerwatch/erigon-lib v0.0.0-20230627104814-797724496a65 h1:KiLnZa8ALmNovK96dQ6gvXf01RFxJYNB/rqjdtIW4Go=
github.com/ledgerwatch/erigon-lib v0.0.0-20230627104814-797724496a65/go.mod h1:DmziKzY3PtjCCAQxqSYvJbRxru/sNHESud6LgO3YWAI=
github.com/ledgerwatch/erigon-lib v0.0.0-20230706040551-efbc6c260daa h1:sCroEMsIMftYOdcknJ8+VMqNgS2/upQt3Bzak1iywGM=
github.com/ledgerwatch/erigon-lib v0.0.0-20230706040551-efbc6c260daa/go.mod h1:DmziKzY3PtjCCAQxqSYvJbRxru/sNHESud6LgO3YWAI=
github.com/ledgerwatch/erigon-snapshot v1.2.1-0.20230622075030-1d69651854c2 h1:Ls2itRGHMOr2PbHRDA4g1HH8HQdwfJhRVfMPEaLQe94=
github.com/ledgerwatch/erigon-snapshot v1.2.1-0.20230622075030-1d69651854c2/go.mod h1:3AuPxZc85jkehh/HA9h8gabv5MSi3kb/ddtzBsTVJFo=
github.com/ledgerwatch/log/v3 v3.8.0 h1:gCpp7uGtIerEz1jKVPeDnbIopFPud9ZnCpBLlLBGqPU=