Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
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
link33
plugin
Commits
0feef75c
Commit
0feef75c
authored
Jun 21, 2019
by
liuyuhang
Committed by
vipwzw
Jun 21, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
del kvmvcc roll back limit
parent
c2820b66
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
13 deletions
+4
-13
kvmvccdb.go
plugin/store/kvmvcc/kvmvccdb.go
+0
-6
kvmvccdb.go
plugin/store/kvmvccmavl/kvmvccdb.go
+4
-7
No files found.
plugin/store/kvmvcc/kvmvccdb.go
View file @
0feef75c
...
...
@@ -16,7 +16,6 @@ import (
)
var
klog
=
log
.
New
(
"module"
,
"kvmvccdb"
)
var
maxRollbackNum
=
200
// SetLogLevel set log level
func
SetLogLevel
(
level
string
)
{
...
...
@@ -272,11 +271,6 @@ func (mvccs *KVMVCCStore) checkVersion(height int64) ([]*types.KeyValue, error)
kvset
=
append
(
kvset
,
kvlist
...
)
klog
.
Debug
(
"store kvmvcc checkVersion DelMVCC4Height"
,
"height"
,
i
,
"maxVersion"
,
maxVersion
)
//为避免高度差过大时出现异常,做一个保护,一次最多回滚200个区块
count
++
if
count
>=
maxRollbackNum
{
break
}
}
}
...
...
plugin/store/kvmvccmavl/kvmvccdb.go
View file @
0feef75c
...
...
@@ -15,6 +15,7 @@ import (
"github.com/33cn/chain33/queue"
"github.com/33cn/chain33/types"
"github.com/golang/protobuf/proto"
"time"
)
const
(
...
...
@@ -26,7 +27,6 @@ const (
)
var
(
maxRollbackNum
=
200
// 是否开启裁剪
enablePrune
bool
// 每个10000裁剪一次
...
...
@@ -294,7 +294,6 @@ func (mvccs *KVMVCCStore) checkVersion(height int64) ([]*types.KeyValue, error)
}
else
if
maxVersion
==
height
-
1
{
return
nil
,
nil
}
else
{
count
:=
1
for
i
:=
maxVersion
;
i
>=
height
;
i
--
{
hash
,
err
:=
mvccs
.
mvcc
.
GetVersionHash
(
i
)
if
err
!=
nil
{
...
...
@@ -309,11 +308,6 @@ func (mvccs *KVMVCCStore) checkVersion(height int64) ([]*types.KeyValue, error)
kvset
=
append
(
kvset
,
kvlist
...
)
kmlog
.
Debug
(
"store kvmvcc checkVersion DelMVCC4Height"
,
"height"
,
i
,
"maxVersion"
,
maxVersion
)
//为避免高度差过大时出现异常,做一个保护,一次最多回滚200个区块
count
++
if
count
>=
maxRollbackNum
{
break
}
}
}
...
...
@@ -345,7 +339,10 @@ func pruning(db dbm.DB, height int64) {
func
pruningMVCC
(
db
dbm
.
DB
,
height
int64
)
{
setPruning
(
pruningStateStart
)
defer
setPruning
(
pruningStateEnd
)
start
:=
time
.
Now
()
pruningFirst
(
db
,
height
)
end
:=
time
.
Now
()
kmlog
.
Debug
(
"pruningMVCC"
,
"height"
,
height
,
"cost"
,
end
.
Sub
(
start
))
}
func
pruningFirst
(
db
dbm
.
DB
,
curHeight
int64
)
{
...
...
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